Reputation: 932
Scenario: Elastic Beanstalk Environment with Multi Docker platform. NGinx container and PHP7.1 Container PHP/Symfony application
Problem: I need to run Doctrine cli command after deploy to update database. I figured out how to do this dynamically but not automatically with following code.
docker exec $(docker ps | grep php-fpm | awk '{print $1}') php ./bin/console doctrine:schema:update --force
I deploy with CodePipeline/CodeBuild
Upvotes: 1
Views: 954
Reputation: 56
At the end of your Dockerfile
CMD ["/start.sh"]
In your start.sh file
#!/bin/sh
set -xe
php bin/console doctrine:schema:update --force
Upvotes: 1