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