I am having problems with docker-compose getting php-fpm container up with composer install.
I have folder structure like:
docker-compose.yml
containers/
nginx
Dockerfile
php-fpm
Dockerfile
docker-compose.yml:
version: '3'
services:
nginx:
build:
context: ./containers/nginx
ports:
- 80:80
php-fpm:
build:
context: ./containers/php-fpm
tty: true
and in php-fpm/Dockerfile:
FROM php:7.1.5-fpm-alpine
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /srv/www
ENTRYPOINT composer install --prefer-source --no-interaction --no-autoloader
With current ENTRYPOINT, it seems that composer install gets stuck at "Generating autoload files", because nothing after that is outputted and container does not appear in docker ps list.
How can I keep above folder structure, but still able to run composer install after build or run (in this case I would need to add if conditions)?