How can I run sequelize db:migrate on ElasticBeanstalk with env vars?
Running sequelize migrate fails since it cannot find the .env
file.<
I just found out what's going on with environment variables. Try running the migration script without npm
. It'll be something like:
./node_modules/.bin/sequelize db:migrate
This way, you'll get all the environment variables as you expect.
Are you sure your .env
file is committed to your git repo? In general, it's not a good idea to commit a .env
to git and use it in production. You should instead set environment variables in your Elastic Beanstalk dashboard under Software Configuration
.
You could also use the eb
command line utility as documented here.