I'm using the a single container docker version of Elastic Beanstalk to deploy a ruby on rails application (my docker is pre-built). The docker image specifies a CMD of "rails server".
I would like to issue "rake db:migrate" just before the "rails server" is run. Is there a way to do it using elastic beanstalk configuration or otherwise?
Either you replace the
CMD/ENTRYPOINT
with a script where you run that inside the running docker container (runs each time you start the docker container), or you add this to.ebextensions/00-my-tasks.config
:Then it runs in the elastic-beanstalk container/virtual machine, but outside of docker container.