services:
    laravel:
        build:
            context: ./docker/8.2
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            XDEBUG_MODE: '${XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${XDEBUG_CONFIG:-client_host=host.docker.internal}'
        volumes:
            - '.:/var/www/html'
        networks:
            - common-network
        depends_on:
            - mysql
    mysql:
        container_name: mysql
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: 'root'
            MYSQL_ROOT_USER: 'root'
            MYSQL_ROOT_HOST: "%"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        volumes:
            - 'mysql:/var/lib/mysql'
        networks:
            - common-network
    myadmin:
        image: phpmyadmin/phpmyadmin:5.0.1
        container_name: phpmyadmin
        environment:
            PMA_HOST: mysql
            PMA_USER: root
            PMA_PASSWORD: root
            UPLOAD_LIMIT: 300M
        ports:
            - "8071:80"
        networks:
            - common-network
networks:
    common-network:
        external: true
volumes:
    mysql:
        driver: local

