version: "3.1"
services:
    www:
        build:
            context: ..
            dockerfile: docker_app/php/Dockerfile
        ports: 
            - "8080:80"
        volumes:
            - ../web:/var/www/html/
            - ./php/config.inc.php:/var/www/html/config.inc.php
        links:
            - db
        networks:
            - default
    db:
        image: mysql:8.0
        ports: 
            - "3305:3306"
        command: --default-authentication-plugin=mysql_native_password
        environment:
            MYSQL_DATABASE: mrbs 
            MYSQL_USER: mrbs
            MYSQL_PASSWORD: mrbs
            MYSQL_ROOT_PASSWORD: mrbs
        volumes:
            - ./init-db.sql:/docker-entrypoint-initdb.d/010-tables.sql
            - persistent:/var/lib/mysql
        networks:
            - default
    phpmyadmin:
        image: phpmyadmin
        links: 
            - db:db
        ports:
            - 8887:80
volumes:
    persistent:
