version: '3' services: traefik: image: "traefik:v2.0" container_name: "traefik" command: - "--api.insecure=true" - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true" - "--certificatesresolvers.mytlschallenge.acme.email=hanemile@protonmail.com" - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" - "--metrics.prometheus=true" ports: - "80:80" - "443:443" - "8080:8080" volumes: - "./letsencrypt:/letsencrypt" - "/var/run/docker.sock:/var/run/docker.sock:ro" labels: - "traefik.enable=true" - "traefik.http.routers.traefik.entrypoints=web" - "traefik.http.routers.traefik.rule=Host(`traefik.${HOSTNAME}`)" - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.traefik.middlewares=traefik-https-redirect" - "traefik.http.routers.traefik-secure.entrypoints=websecure" - "traefik.http.routers.traefik-secure.rule=Host(`traefik.${HOSTNAME}`)" - "traefik.http.routers.traefik-secure.tls=true" - "traefik.http.routers.traefik-secure.tls.certresolver=mytlschallenge" - "traefik.http.routers.traefik-secure.service=api@internal" - "traefik.http.services.traefik.loadbalancer.server.port=8080" networks: - circus register: image: "circus-register:latest" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" ports: - "8081:8081" environment: - HOSTNAME=${HOSTNAME} labels: - "traefik.enable=true" - "traefik.http.routers.register.entrypoints=web" - "traefik.http.routers.register.rule=Host(`register.${HOSTNAME}`)" - "traefik.http.middlewares.register-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.register.middlewares=register-https-redirect" - "traefik.http.routers.register-secure.entrypoints=websecure" - "traefik.http.routers.register-secure.rule=Host(`register.${HOSTNAME}`)" - "traefik.http.routers.register-secure.tls=true" - "traefik.http.routers.register-secure.tls.certresolver=mytlschallenge" - "traefik.http.routers.register-secure.service=register" - "traefik.http.services.register.loadbalancer.server.port=8081" networks: - circus scoreboard: image: "circus-scoreboard:latest" container_name: "scoreboard" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" ports: - "8082:8080" environment: - HOSTNAME=${HOSTNAME} labels: - "traefik.enable=true" - "traefik.http.routers.scoreboard.entrypoints=web" - "traefik.http.routers.scoreboard.rule=Host(`scoreboard.${HOSTNAME}`)" #- "traefik.http.middlewares.scoreboard-https-redirect.redirectscheme.scheme=https" #- "traefik.http.routers.scoreboard.middlewares=scoreboard-https-redirect" - "traefik.http.routers.scoreboard-secure.entrypoints=websecure" - "traefik.http.routers.scoreboard-secure.rule=Host(`scoreboard.${HOSTNAME}`)" - "traefik.http.routers.scoreboard-secure.tls=true" - "traefik.http.routers.scoreboard-secure.tls.certresolver=mytlschallenge" - "traefik.http.routers.scoreboard-secure.service=scoreboard" - "traefik.http.services.scoreboard.loadbalancer.server.port=8080" networks: - circus prometheus: image: "prom/prometheus:latest" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" command: - "--config.file=/etc/prometheus/prometheus.yml" volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro ports: - "9090:9090" labels: - "traefik.enable=true" - "traefik.http.routers.prometheus.entrypoints=web" - "traefik.http.routers.prometheus.rule=Host(`prometheus.${HOSTNAME}`)" - "traefik.http.middlewares.prometheus-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.prometheus.middlewares=prometheus-https-redirect" - "traefik.http.routers.prometheus-secure.entrypoints=websecure" - "traefik.http.routers.prometheus-secure.rule=Host(`prometheus.${HOSTNAME}`)" - "traefik.http.routers.prometheus-secure.tls=true" - "traefik.http.routers.prometheus-secure.tls.certresolver=mytlschallenge" - "traefik.http.routers.prometheus-secure.service=prometheus" - "traefik.http.services.prometheus.loadbalancer.server.port=9090" networks: - circus networks: circus: external: name: circus