services:
    php:
        container_name: php
        build: .docker/php
        user: "${UID:-1000}:${GID:-1000}"
        ports:
            - ${DOCKER_PHP_PORT}:5173
        volumes:
            - ./:/var/www/adiplix-api:cached
            - ../exclusive2:/var/www/exclusive2:cached
        networks:
            - exclusivesis-adiplix
    vue:
        container_name: vue
        image: node:20-alpine
        working_dir: /app
        volumes:
            - ../adiplix-app-front-end-vue:/app:cached
        ports:
            - ${DOCKER_VUE_PORT:-5174}:5173
        command: sh -c "npm install && npm run dev -- --host"
        networks:
            - exclusivesis-adiplix
    nginx:
        container_name: nginx
        image: nginx
        ports:
            - ${DOCKER_NGINX_PORT}:8080
            - ${DOCKER_NGINX_PORT_EXCLUSIVE}:8000
            - 8040:8040
        volumes:
            - ./:/var/www/adiplix-api:cached
            - ../exclusive2:/var/www/exclusive2:cached
            - .docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
            - .docker/nginx/nginx.conf:/etc/nginx/nginx.conf
        depends_on:
            - php
        networks:
            - exclusivesis-adiplix
        

    db:
        container_name: mysql
        image: mysql:8.2
        ports:
            - ${DOCKER_MYSQL_PORT}:3306
        volumes:
            - .docker/db/data_mysql:/var/lib/mysql
            - .docker/db/my.cnf:/etc/mysql/conf.d/my.cnf
            - .docker/logs:/var/log/mysql
            - .docker/db/sql:/docker-entrypoint-initdb.d
        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: ${DB_DATABASE}
            MYSQL_USER: ${DB_USERNAME}
            MYSQL_PASSWORD: ${DB_PASSWORD}
        networks:
            - exclusivesis-adiplix
     
    mail:
        container_name: mail
        image: axllent/mailpit:latest
        ports:
            - ${DOCKER_MAIL_HTTP_PORT}:8025
            - ${DOCKER_MAIL_SMTP_PORT}:1025
        networks:
            - exclusivesis-adiplix

networks:
    exclusivesis-adiplix:
        #external: true
        driver: bridge

volumes:
    dbvolume:
        driver: local