version: '3'
services:
    class:
        container_name: class
        build:
            context: .
            args:
                WWWGROUP: '${WWWGROUP}'
        ports:
            - '${APP_PORT:-80}:8030'
        environment:
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
            IGNITION_LOCAL_SITES_PATH: '${PWD}'
        volumes:
            - '.:/var/www/html'
        networks:
            - class_network

    mysql:
      image: mysql:8.0
      container_name: class-mysql-service
      restart: unless-stopped

      environment:
        MYSQL_ROOT_HOST: '%'
        MYSQL_ROOT_PASSWORD: 'password'
        MYSQL_DATABASE: 'tsbi_courses_sa'
        MYSQL_PASSWORD: 'password'
        MYSQL_USER: 'mysql_root'
        SERVICE_TAGS: dev
        SERVICE_NAME: mysql

      volumes:
        - ./docker-compose/mysql:/docker-entrypoint-initdb.d
      networks:
        - class_network

    phpmyadmin:
      image: phpmyadmin
      container_name: class-phpmyadmin-service
      restart: always
      ports:
        - 9002:80
      environment:
        PMA_ARBITRARY: 1
        PMA_HOST: class-mysql-service
        PMA_USER: 'mysql_root'
        PMA_PASSWORD: 'password'
        UPLOAD_LIMIT: 8000M

      networks:
        - class_network


networks:
    class_network:
        name: class_network
        driver: bridge

