Search code examples
node.jssequelize.jsamazon-elastic-beanstalksequelize-cli

Deploying process nodejs + sequelize on aws beanstalk


I'm using node + sequlize js on aws beanstalk.
I've several questions related to deploying process:

  1. How to deploy automatically master to beanstalks? should I use some bash script?
  2. How to run migration automatically on the production server. should I ssh the server after the deploy and run it manually? please no.

Thank you for your help


Solution

  • Here you can find the answer: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

    container_commands: collectstatic: command: "django-admin.py collectstatic --noinput" 01syncdb: command: "django-admin.py syncdb --noinput" leader_only: true 02migrate: command: "django-admin.py migrate" leader_only: true 99customize: command: "scripts/customize.sh"