services:
    laravel.test:
        build:
            context: './vendor/laravel/sail/runtimes/8.4'
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: 'sail-8.4/app'
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT:-80}:80'
            - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
        environment:
            WWWGROUP: '${WWWGROUP:-1000}'
            WWWUSER: '${WWWUSER:-1000}'
            LARAVEL_SAIL: 1
            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:
            - sail
        depends_on:
            - mysql

    mysql:
        image: mysql:8.0
        ports:
        - '3306:3306'

        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: CR-GSL-DB
            MYSQL_USER: sail
            MYSQL_PASSWORD: password

        volumes:
            - ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
            - mysql_data:/var/lib/mysql
        networks:
            - sail

networks:
    sail:
        driver: bridge

volumes:
    mysql_data:
