version: '2'
services:
    web:
        build:
            context: ./
            dockerfile: web.docker
        volumes:
            - ./:/var/www
        ports:
            - "8080:80"
        links:
            - app
    app:
        build:
            context: ./
            dockerfile: app.docker
        volumes:
            - ./:/var/www
        links:
            - database
        environment:
            - "DB_PORT=3306"
            - "DB_HOST=database"
    database:
        image: mysql:5.7
        volumes:
            - ./db:/var/lib/mysql
        restart: always
        environment:
            - "MYSQL_ROOT_PASSWORD=mysql"
            - "MYSQL_DATABASE=courierman"
        ports:
            - "33061:3306"
