I am using official Docker Php-fpm (https://github.com/docker-library/php/blob/master/7.2/alpine3.8/fpm/Dockerfile) and official Nginx Image for my php website. I have configured Nginx to talk to php-fpm over port 9000. The entrypoint of the docker is given below.
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- php-fpm "$@"
fi
exec "$@"
You can see when we try to execute a command like docker exec -it container whoami
, it is prefixed with php-fpm
.
So my question is when I pass a PHP cli script like e.g docker exec -it container composer install
how it is interpreted ? does composer install
processed by php-fpm or php-cli (/usr/local/bin/php) ?
As per my knowledge composer is a cli script which I install like below should be processed by php-cli.
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin -- --filename=composer