How to run sequelize db:migrate on Elastic Beanstalk EB with env vars? How to access .env vars in container commands?

前端 未结 3 1519
梦如初夏
梦如初夏 2021-01-22 04:56

How can I run sequelize db:migrate on ElasticBeanstalk with env vars?

Running sequelize migrate fails since it cannot find the .env file.<

3条回答
  •  無奈伤痛
    2021-01-22 05:21

    I resolve this error through running command in .ebextension/config_file.sh node vsersion is same which is using in the EB console

    files: "/opt/elasticbeanstalk/hooks/appdeploy/pre/config_file.sh":

    mode: "000755"
    owner: root
    group: root
    content: |
      #!/bin/bash
      
      curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
      
      sudo yum -y install nodejs
    

    then

    run command on terminal in your app directory:

    ./node_modules/.bin/sequelize db:migrate

    its work for me!!

提交回复
热议问题