I need to run docker-compose with two containers,- php-fpm and php-cli. Although I need another container with composer.
When I run docker-compose up -d - container with php-cli become always restarting and composer container just stops.
I need to run docker-compose with two containers,- php-fpm and php-cli. Although I need another container with composer.
When I run docker-compose up -d - container with php-cli become always restarting and composer container just stops.
PHP cli is not running in daemon mode. You run it, and then it stops. Next, Docker tries to restart it (you've set restart: always policy for php-cli). :)
IMO php-cli and composer services are redundant. You can use php service for your needs. Simply run docker-compose run php php [path to script]
php, Docker php-cli and Docker php-fpm, see also question, here: devops.stackexchange.com/questions/9505/…php-fpm docker image can handle all of the required things: running script in CLI mode and running composer (ie via the phar archive).