name: moznexsrv

services:
    node-builder:
        image: node:20-alpine
        working_dir: /var/www/html
        volumes:
            - '.:/var/www/html'
            - ../../../infra/certs:/etc/ssl/certs:ro
        command: sh -c "npm ci && npm start"
        environment:
            SERVER_NAME: ${SERVER_NAME}
            NODE_EXP_PORT: 8080
        expose:
            - "8080"
        labels:
            - traefik.enable=true
            - traefik.http.routers.moznexsrv.rule=Host(`moznexsrv.mozartdigital.docker`)
            - traefik.http.routers.moznexsrv.entrypoints=websecure
            - traefik.http.routers.moznexsrv.tls=true
            - traefik.http.services.moznexsrv.loadbalancer.server.port=8080
            - traefik.docker.network=mozart-network
        ports:
            - "8081:8080"
        networks: [ mozart-network ]
networks:
    mozart-network:
        external: true