name: mcp
services:
    mcp-php:
        build:
            context: ../../../infra/docker/php84-fpm
        volumes:
            - ${DOCUMENT_ROOT:-./}:/var/www/html
            - ./config/php/php.ini:/usr/local/etc/php/php.ini
            - ./config/php-fpm/www.conf:/usr/local/etc/php-fpm.d/www.conf
            - ${HOME}/.ssh/id_rsa:/root/.ssh/id_rsa:ro
            - ${HOME}/.ssh/known_hosts:/root/.ssh/known_hosts:ro
        networks: [ mcp-priv, mozart-network ]
        extra_hosts:
            - "host.docker.internal:host-gateway"
    nginx:
        image: nginx:alpine
        depends_on: [ mcp-php ]
        volumes:
            - ${DOCUMENT_ROOT:-./}:/var/www/html:ro
            - ./config/nginx/conf.d:/etc/nginx/conf.d:ro
        networks: [ mcp-priv, mozart-network ]
        expose:
            - "80"
        labels:
            - traefik.enable=true
            - traefik.http.routers.mcpmozartdigital.rule=Host(`${SERVER_NAME}`)
            - traefik.http.routers.mcpmozartdigital.entrypoints=websecure
            - traefik.http.routers.mcpmozartdigital.tls=true
            - traefik.http.services.mcpmozartdigital.loadbalancer.server.port=80
            - traefik.docker.network=mozart-network
        extra_hosts:
            - "host.docker.internal:host-gateway"

networks:
    mcp-priv:
    mozart-network:
        external: true
