version: '2'

services:
    db:
        image: mysql:5.7
        command: mysqld --sql_mode=""
        volumes:
            - "./.data/db:/var/lib/mysql"
            - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
        environment:
            MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
            MYSQL_DATABASE: ${MYSQL_DATABASE}
            MYSQL_USER: ${MYSQL_USER}
            MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        ports:
            - 3306:3306
    php:
        build: php7-fpm
        ports:
            - 9000:9000
        volumes:
            - ${SYMFONY_APP_PATH}:/var/www/symfony
            - ./logs/symfony:/var/www/symfony/var/log
    nginx:
        build: nginx
        ports:
            - 80:80
        volumes_from:
            - php
        volumes:
            - ./logs/nginx/:/var/log/nginx
    adminer:
        image: adminer
        ports:
            - 8080:8080
        links:
            - db
