I'm looking for a way to use sequelize-cli on an elastic beanstalk deployment strategie. However right now I do not get it working. It seems right now that the config is missing. Not sure if the problem results from:
- missing .env vars
- Sequelize / config not reading dot env vars correctly
What I got so far:
- make npm available
#.ebextensions/00_npm.conf
container_commands:
00_node_binary:
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/node /bin/node"
00_npm_binary:
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-inst
all/node-* | head -1`/bin/npm /bin/npm"
- trigger miggrations
#.ebextensions/10_sequelize_migrate.conf
container_commands:
10_sequelize_migrate:
command: npm run migrate
leader_only: true
- packacke json
{
...,
"scripts": {
"start": "node index.js",
"development": "nodemon ./server.js --exec babel-node",
}
}
config/config.js
module exports = {
....,
"production": {
"username": process.env.RDS_USERNAME || null,
"password": process.env.RDS_PASSWORD || null,
"host" : process.env.RDS_HOSTNAME || null,
"port" : process.env.RDS_PORT || null,
"database": process.env.RDS_DATABASE || null,
}
}
Error:
{ Error: ENOENT: no such file or directory, open '.env'
As far as I know there is no .env file on amazon. It sets env vars.
Similar related questions
I'm looking for a way to use sequelize-cli on an elastic beanstalk deployment strategie. However right now I do not get it working. It seems right now that the config is missing. Not sure if the problem results from:
What I got so far:
config/config.js
Error:
As far as I know there is no .env file on amazon. It sets env vars.
Similar related questions