Run symfony console on container start

759 Views Asked by At

I'm looking for a way, to execute symfonys console after a docker container is started, such as a database migration. I'm using a alpine php-fpm image, which has the following command at the end of its Dockerfile:

CMD     ["php-fpm"]

When i try to override this in my docker-compose file, either php-fpm won't start or the symfony console command won't run. Ideally the execution should wait a few seconds, to ensure that the database is started.

What would be a good solution for this scenario?

0

There are 0 best solutions below