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

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