version: "3.9"

services:
  prothmann:
    container_name: prothmann
    image: canetzberger/www.prothmann.com
    build: .
    environment:
      NODE_ENV: production
    networks:
      - traefik_proxy
    command: npm start
    volumes:
      # mount current dir into docker container
      - .:/my-app
      # ignore local node_modules, use container
      - /my-app/node_modules
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.prothmann.entrypoints=http"
      - "traefik.http.routers.prothmann.rule=Host(`www.prothmann.com`)"
      - "traefik.http.middlewares.prothmann-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.prothmann.middlewares=prothmann-https-redirect"
      - "traefik.http.routers.prothmann-secure.entrypoints=https"
      - "traefik.http.routers.prothmann-secure.rule=Host(`www.prothmann.com`)"
      - "traefik.http.routers.prothmann-secure.tls=true"
      - "traefik.http.routers.prothmann-secure.tls.certresolver=http"
      - "traefik.http.routers.prothmann-secure.service=prothmann"
      - "traefik.http.services.prothmann.loadbalancer.server.port=3001"
      - "traefik.docker.network=traefik_proxy"
      - "traefik.http.routers.prothmann-secure.middlewares=secHeaders@file"

networks:
  traefik_proxy:
    external: true
