version: '3.8'

services:
    # Laravel application service
    app:
        build:
            context: .docker
            dockerfile: Dockerfile
            args:
                - UID=${UID:-1000}
                - GID=${GID:-1000}
                - USERNAME=laravel
        container_name: laravel_app
        dns:
            - 8.8.8.8 # this is used to allow the container to use the internet
            - 8.8.4.4
        user: "1000:1000"
        ports:
            - "8008:80" # Expose Apache on port 8080
        volumes:
            - .:/var/www/html # Sync current directory to container's /var/www/html
            - ./.docker/volumes/apache/000-default.conf:/etc/apache2/sites-available/000-default.conf
            - ./.docker/volumes/zsh/.zsh_history:/home/laravel/.zsh_history

        depends_on:
            - mysql

    # MySQL service
    mysql:
        image: mysql:8.0.39
        container_name: mysql
        volumes:
            - ./.docker/volumes/mysql:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=1234
            - MYSQL_DATABASE=laravel
        ports:
            - "3307:3306"

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        container_name: phpmyadmin
        restart: always
        depends_on:
            - mysql
        ports:
            - "8001:80"
        environment:
            PMA_HOST: mysql
            PMA_PORT: 3306

