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.dnschallenge=true" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.delaybeforecheck=0" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.provider=cloudflare" - "--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" - "./traefik_users:/traefik_users" labels: - "traefik.enable=true" - "traefik.http.routers.traefik.entrypoints=web" - "traefik.http.routers.traefik.rule=Host(`traefik.${HOSTNAME}`)" - "traefik.http.middlewares.traefik-auth.basicauth.usersFile=/traefik_users" - "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.middlewares=traefik-auth" - "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" - "prometheus_data:/prometheus" 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 grafana: image: "grafana/grafana" container_name: "grafana" volumes: - "grafana_data:/var/lib/grafana" - "./grafana.ini:/etc/grafana/grafana.ini" environment: - "GF_SERVER_ROOT_URL=http://grafana.docker.localhost:3000" - "GF_SECURITY_ADMIN_PASSWORD=secret" ports: - "3000:3000" labels: - "traefik.enable=true" - "traefik.http.routers.grafana.entrypoints=web" - "traefik.http.routers.grafana.rule=Host(`grafana.${HOSTNAME}`)" - "traefik.http.middlewares.grafana-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.grafana.middlewares=grafana-https-redirect" - "traefik.http.routers.grafana-secure.entrypoints=websecure" - "traefik.http.routers.grafana-secure.rule=Host(`grafana.${HOSTNAME}`)" - "traefik.http.routers.grafana-secure.tls=true" - "traefik.http.routers.grafana-secure.tls.certresolver=mytlschallenge" - "traefik.http.routers.grafana-secure.service=grafana" - "traefik.http.services.grafana.loadbalancer.server.port=3000" networks: - circus networks: circus: external: name: circus volumes: prometheus_data: {} grafana_data: {}