name: pling
services:
    pling-php:
        build:
            context: ../../../infra/docker/php84-fpm
        volumes:
            - ${DOCUMENT_ROOT:-./www}:/var/www/html
            - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/php.ini
            - ../../../infra/certs:/etc/ssl/certs:ro
            - ./.env.local:/var/www/html/.env.local:ro
            - ${HOME}/.ssh/id_rsa:/root/.ssh/id_rsa:ro
            - ${HOME}/.ssh/known_hosts:/root/.ssh/known_hosts:ro
        networks: [ pling-priv, mozart-network ]
        extra_hosts:
            - "host.docker.internal:host-gateway"
            - "www.mozartprestigepatrimoine.docker:host-gateway"
            - "www.heritage.mozartprestigepatrimoine.docker:host-gateway"
            - "www.mozartdigital.docker:host-gateway"
            - "www.monmarcheimmobilier.docker:host-gateway"
            - "www.pma.docker:host-gateway"
            - "www.traefik.docker:host-gateway"
            - "api.mozartdigital.docker:host-gateway"
            - "wolfgang.mozartdigital.docker:host-gateway"
            - "simulpdf.mozartdigital.docker:host-gateway"
            - "pdf.mozartdigital.docker:host-gateway"
            - "www.xhprof.docker:host-gateway"
            - "www.pling.docker:host-gateway"
            - "moznexsrv.mozartdigital.docker:host-gateway"
            - "mcp.mozartdigital.docker:host-gateway"
    nginx:
        image: nginx:alpine
        depends_on: [ pling-php ]
        environment:
            SERVER_NAME: ${SERVER_NAME}
        volumes:
            - ${DOCUMENT_ROOT:-./www}:/var/www/html:ro
            - ./config/nginx/conf.d:/etc/nginx/conf.d:ro
        networks: [ pling-priv, mozart-network ]
        expose:
            - "80"
        labels:
            - traefik.enable=true
            - traefik.http.routers.pling.rule=Host(`${SERVER_NAME}`)
            - traefik.http.routers.pling.entrypoints=websecure
            - traefik.http.routers.pling.tls=true
            - traefik.http.services.pling.loadbalancer.server.port=80
            - traefik.docker.network=mozart-network
        extra_hosts:
            - "host.docker.internal:host-gateway"
networks:
    pling-priv:
    mozart-network:
        external: true
volumes:
    pling:
        external: true
