Docker Community Forums

Share and learn in the Docker community.

Auto database update (Auto execute of an command after container start)?

Hello,

i’m quite new to docker so i try to learn.
Today i try to dockerize my PHP application.

So i want to build an image which contains nginx + php (fpm).
I guess this should not be the problem, my main problem is how i can update automatically the database if i update the application.

Want i want is to execute the migration command of symfony (php framework) always on startup, so the database is always up2date.

Is that possible without a docker-compose file with the command option ?
Maybe i know to less about docker, but it seems its not that user friendly if a user has to create a docker-compose file with that option for one image.

Thanks!