From f916adc2b413ae64432ddf3a0fa919f7bdea423e Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 15 Sep 2020 10:52:37 +0200 Subject: [PATCH] Simplify traefik configuration --- doc/docker-compose.yml | 17 +++++++++++++---- doc/traefik/traefik.yml | 26 -------------------------- 2 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 doc/traefik/traefik.yml diff --git a/doc/docker-compose.yml b/doc/docker-compose.yml index 06cbeba..f996bc2 100644 --- a/doc/docker-compose.yml +++ b/doc/docker-compose.yml @@ -12,11 +12,20 @@ services: - 1935:1935 volumes: - /var/run/docker.sock:/var/run/docker.sock - - ./traefik/traefik.yml:/etc/traefik/traefik.yml - ./traefik_data:/data - labels: - # middleware hsts - - "traefik.http.middlewares.security_header.headers.stsPreload=true" + command: + # Read docker-compose labels but do not expose by default + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + # Define entrypoints + - "--entrypoints.web.address=:80" + - "--entrypoints.web.http.redirections.entryPoint.to=websecure" + - "--entrypoints.websecure.address=:443" + - "--entrypoints.rtmpsecure.address=:1935" + # Define certificates + - "--certificatesResolvers.mytlschallenge.acme.email=root@example.com" + - "--certificatesResolvers.mytlschallenge.acme.storage=/data/acme.json" + - "--certificatesResolvers.mytlschallenge.acme.httpChallenge.entryPoint=web" # RTMP to WebRTC server ovenmediaengine: diff --git a/doc/traefik/traefik.yml b/doc/traefik/traefik.yml deleted file mode 100644 index d1376e9..0000000 --- a/doc/traefik/traefik.yml +++ /dev/null @@ -1,26 +0,0 @@ -providers: - docker: - # Do not expose containers by default - exposedbydefault: False - -entryPoints: - web: - address: ":80" - http: - redirections: - entryPoint: - to: web-secure - scheme: https - websecure: - address: ":443" - rtmpsecure: - address: ":1935" - -certificatesResolvers: - mytlschallenge: - acme: - email: root@example.com - storage: /data/acme.json - httpChallenge: - entryPoint: web -