소스 검색

traefik tls config

Jason Playne 3 년 전
부모
커밋
e815c4ebb6
2개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      network/docker-compose.yml
  2. 15 0
      network/traefik/traefik.yml

+ 3 - 0
network/docker-compose.yml

@@ -18,6 +18,7 @@ services:
     volumes:
       # So that Traefik can listen to the Docker events
       - /var/run/docker.sock:/var/run/docker.sock
+      - ./traefik:/etc/traefik/
 
   heimdall:
     environment:
@@ -85,6 +86,8 @@ services:
       - postgres
     labels:
       - traefik.http.routers.nextcloud.rule=Host(`cloud.playne.au`)
+      - traefik.http.routers.nextcloud.tls=true
+      - traefik.http.routers.nextcloud.tls.certresolver=le
 
   postgres:
     image: postgres:14

+ 15 - 0
network/traefik/traefik.yml

@@ -0,0 +1,15 @@
+entryPoints:
+  web:
+    address: ":80"
+
+  websecure:
+    address: ":443"
+
+certificatesResolvers:
+  le:
+    acme:
+      email: jason@jasonplayne.com
+      storage: /etc/traefik/acme.json
+      httpChallenge:
+        # used during the challenge
+        entryPoint: web