version: '3.7'

services:
    nginx:
        build:
            args:
                VERSION: $NGINX_VERSION
            context: .
            dockerfile: ./docker/nginx/Dockerfile
            target: dev
        depends_on:
            - php-fpm
        ports:
            - 80:80
    php-fpm:
        build:
            args:
                VERSION: $PHP_VERSION
            context: .
            dockerfile: ./docker/php-fpm/Dockerfile
            target: test
        volumes:
            - .:/app
            - ~/etc/timezone:/etc/localtime:ro

        command: sh -c 'composer install --no-interaction --optimize-autoloader && bin/console assets:install && php-fpm'
networks:
    default:
        driver: bridge