version: '3'

services:
    nginx:
        image: stenfrank/nginx:1.3
        working_dir: /var/www/html
        ports:
            - "${APP_PORT}:80"
        volumes:
            - ./:/var/www/html
            - ./docker/nginx/sites-available:/etc/nginx/sites-available
        networks:
            - api_dian
    php:
        image: stenfrank/php:1.3
        working_dir: /var/www/html
        volumes:
            - ./:/var/www/html
        networks:
            - api_dian
    mariadb:
        image: mariadb
        environment:
            - MYSQL_USER=${MYSQL_USER}
            - MYSQL_PASSWORD=${MYSQL_PASSWORD}
            - MYSQL_DATABASE=${MYSQL_DATABASE}
            - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        ports:
            - "3307:3306"
        volumes:
            - mysqldata:/var/lib/mysql
        networks:
            - api_dian

networks:
    api_dian:
        driver: "bridge"

volumes:
    mysqldata:
        driver: "local"
