Pārlūkot izejas kodu

traefik tls config

Jason Playne 3 gadi atpakaļ
vecāks
revīzija
e815c4ebb6
2 mainītis faili ar 18 papildinājumiem un 0 dzēšanām
  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