|
@@ -0,0 +1,57 @@
|
|
|
+---
|
|
|
+services:
|
|
|
+ proxy:
|
|
|
+ image: traefik:v2.11
|
|
|
+ container_name: proxy
|
|
|
+ restart: unless-stopped
|
|
|
+ command:
|
|
|
+ - '--api'
|
|
|
+ - '--global.sendAnonymousUsage=false'
|
|
|
+ - '--global.checkNewVersion=false'
|
|
|
+ - '--log=true'
|
|
|
+ - '--log.level=DEBUG'
|
|
|
+ - '--log.format=common'
|
|
|
+ # providers
|
|
|
+ - "--providers.docker=true"
|
|
|
+ - "--providers.docker.network=proxy"
|
|
|
+ - "--providers.docker.exposedByDefault=false"
|
|
|
+ - "--providers.file.directory=/etc/traefik/"
|
|
|
+ - "--providers.file.watch=true"
|
|
|
+ - "--entrypoints.web.address=:80"
|
|
|
+ - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
|
|
+ - "--entryPoints.web.http.redirections.entrypoint.scheme=https"
|
|
|
+ - "--entrypoints.websecure.address=:443"
|
|
|
+ ports:
|
|
|
+ - "80:80"
|
|
|
+ - "443:443"
|
|
|
+ volumes:
|
|
|
+ - "./data/traefik/config:/etc/traefik"
|
|
|
+ - "./data/traefik/certs:/etc/traefik/certs"
|
|
|
+ - "./data/traefik/letsencrypt:/letsencrypt"
|
|
|
+ - "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
|
+ networks:
|
|
|
+ - proxy
|
|
|
+ labels:
|
|
|
+ - "traefik.enable=true"
|
|
|
+ # API & Dashboard
|
|
|
+ - "traefik.http.routers.dashboard.rule=(Host(`dashboard.vollivier.vm.vdi.s1.p.fti.net`) || Host(`oxygen`))&& (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
|
|
+ - "traefik.http.routers.dashboard.service=api@internal"
|
|
|
+ - "traefik.http.routers.dashboard.entrypoints=websecure"
|
|
|
+ - "traefik.http.routers.dashboard.tls=true"
|
|
|
+ - "traefik.http.routers.dashboard.middlewares=auth"
|
|
|
+ - "traefik.http.middlewares.auth.basicauth.users=systemteam:$$apr1$$h3dnhusI$$T8H/kgPsfHQlOlIAygV7e/" # Q2nZkXhrqu54cQR5
|
|
|
+
|
|
|
+ ## middleware redirect
|
|
|
+ #- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
|
|
+
|
|
|
+ ## global redirect to https
|
|
|
+ #- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
|
|
|
+ #- "traefik.http.routers.redirs.entrypoints=web"
|
|
|
+ #- "traefik.http.routers.redirs.middlewares=redirect-to-https"
|
|
|
+
|
|
|
+
|
|
|
+networks:
|
|
|
+ proxy:
|
|
|
+ name: proxy
|
|
|
+ # web:
|
|
|
+ # name: web
|