Просмотр исходного кода

Merge pull request #102 from ChristianLempa/101-update-traefik-config

101 update traefik config
Christian Lempa 2 лет назад
Родитель
Сommit
dad1f86265
2 измененных файлов с 47 добавлено и 32 удалено
  1. 32 28
      docker-compose/traefik/config/traefik.yaml
  2. 15 4
      docker-compose/traefik/docker-compose.yaml

+ 32 - 28
docker-compose/traefik/config/traefik.yml → docker-compose/traefik/config/traefik.yaml

@@ -1,89 +1,93 @@
 global:
 global:
-  checkNewVersion: true
-  sendAnonymousUsage: false  # true by default
+  checkNewVersion: false
+  sendAnonymousUsage: false
 
 
-# (Optional) Log information
-# ---
+# -- (Optional) Change Log Level and Format here...
+#     - loglevels [DEBUG, INFO, WARNING, ERROR, CRITICAL]
+#     - format [common, json, logfmt]
 # log:
 # log:
-#  level: ERROR  # DEBUG, INFO, WARNING, ERROR, CRITICAL
-#   format: common  # common, json, logfmt
+#  level: ERROR
+#   format: common
 #   filePath: /var/log/traefik/traefik.log
 #   filePath: /var/log/traefik/traefik.log
 
 
-# (Optional) Accesslog
-# ---
+# -- (Optional) Enable Accesslog and change Format here...
+#     - format [common, json, logfmt]
 # accesslog:
 # accesslog:
-  # format: common  # common, json, logfmt
-  # filePath: /var/log/traefik/access.log
+#   format: common
+#   filePath: /var/log/traefik/access.log
 
 
-# (Optional) Enable API and Dashboard
-# ---
+# -- (Optional) Enable API and Dashboard here, don't do in production
 # api:
 # api:
-#  dashboard: true  # true by default
-#  insecure: true  # Don't do this in production!
+#   dashboard: true
+#   insecure: true
 
 
-# Entry Points configuration
-# ---
+# -- Change EntryPoints here...
 entryPoints:
 entryPoints:
   web:
   web:
     address: :80
     address: :80
-    # (Optional) Redirect to HTTPS
-    # ---
+    # -- (Optional) Redirect all HTTP to HTTPS
     # http:
     # http:
     #   redirections:
     #   redirections:
     #     entryPoint:
     #     entryPoint:
     #       to: websecure
     #       to: websecure
     #       scheme: https
     #       scheme: https
-
   websecure:
   websecure:
     address: :443
     address: :443
+  # -- (Optional) Add custom Entrypoint
+  # custom:
+  #   address: :8080
 
 
-# Configure your CertificateResolver here...
-# ---
+# -- Configure your CertificateResolver here...
 # certificatesResolvers:
 # certificatesResolvers:
 #   staging:
 #   staging:
 #     acme:
 #     acme:
 #       email: your-email@example.com
 #       email: your-email@example.com
 #       storage: /etc/traefik/certs/acme.json
 #       storage: /etc/traefik/certs/acme.json
 #       caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
 #       caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
+#       -- (Optional) Remove this section, when using DNS Challenge
 #       httpChallenge:
 #       httpChallenge:
 #         entryPoint: web
 #         entryPoint: web
-#       -- or pick dns challenge
+#       -- (Optional) Configure DNS Challenge
 #       dnsChallenge:
 #       dnsChallenge:
 #         provider: your-resolver (e.g. cloudflare)
 #         provider: your-resolver (e.g. cloudflare)
 #         resolvers:
 #         resolvers:
 #           - "1.1.1.1:53"
 #           - "1.1.1.1:53"
 #           - "8.8.8.8:53"
 #           - "8.8.8.8:53"
-
 #   production:
 #   production:
 #     acme:
 #     acme:
 #       email: your-email@example.com
 #       email: your-email@example.com
 #       storage: /etc/traefik/certs/acme.json
 #       storage: /etc/traefik/certs/acme.json
 #       caServer: "https://acme-v02.api.letsencrypt.org/directory"
 #       caServer: "https://acme-v02.api.letsencrypt.org/directory"
+#       -- (Optional) Remove this section, when using DNS Challenge
 #       httpChallenge:
 #       httpChallenge:
 #         entryPoint: web
 #         entryPoint: web
-#       -- or pick dns challenge
+#       -- (Optional) Configure DNS Challenge
 #       dnsChallenge:
 #       dnsChallenge:
 #         provider: your-resolver (e.g. cloudflare)
 #         provider: your-resolver (e.g. cloudflare)
 #         resolvers:
 #         resolvers:
 #           - "1.1.1.1:53"
 #           - "1.1.1.1:53"
 #           - "8.8.8.8:53"
 #           - "8.8.8.8:53"
 
 
-# (Optional) Overwrite Default Certificates
+# -- (Optional) Disable TLS Cert verification check
+# serversTransport:
+#   insecureSkipVerify: true
+
+# -- (Optional) Overwrite Default Certificates
 # tls:
 # tls:
 #   stores:
 #   stores:
 #     default:
 #     default:
 #       defaultCertificate:
 #       defaultCertificate:
 #         certFile: /etc/traefik/certs/cert.pem
 #         certFile: /etc/traefik/certs/cert.pem
 #         keyFile: /etc/traefik/certs/cert-key.pem
 #         keyFile: /etc/traefik/certs/cert-key.pem
-# (Optional) Disable TLS version 1.0 and 1.1
+# -- (Optional) Disable TLS version 1.0 and 1.1
 #   options:
 #   options:
 #     default:
 #     default:
 #       minVersion: VersionTLS12
 #       minVersion: VersionTLS12
 
 
 providers:
 providers:
   docker:
   docker:
-    exposedByDefault: false  # Default is true
+    # -- (Optional) Enable this, if you want to expose all containers automatically
+    exposedByDefault: false
   file:
   file:
-    # watch for dynamic configuration changes
     directory: /etc/traefik
     directory: /etc/traefik
     watch: true
     watch: true

+ 15 - 4
docker-compose/traefik/docker-compose.yaml

@@ -1,13 +1,24 @@
 ---
 ---
+# -- (Optional) When using a custom network
+# networks:
+#   your-traefik-network:
+#     external: true
 services:
 services:
   traefik:
   traefik:
-    image: traefik:v2.5
+    image: traefik:v2.10.4
     container_name: traefik
     container_name: traefik
     ports:
     ports:
       - 80:80
       - 80:80
       - 443:443
       - 443:443
-      # - 8080:8080  # (optional) expose the dashboard !don't use in production!
+      # -- (Optional) Enable Dashboard, don't do in production
+      # - 8080:8080
     volumes:
     volumes:
-      - /etc/traefik:/etc/traefik
+      - ./config:/etc/traefik
       - /var/run/docker.sock:/var/run/docker.sock:ro
       - /var/run/docker.sock:/var/run/docker.sock:ro
-    restart: unless-stopped
+    # -- (Optional) When using Cloudflare as Cert Resolver
+    # environment:
+    #   - CF_DNS_API_TOKEN=your-cloudflare-api-token
+    # -- (Optional) When using a custom network
+    # networks:
+    #   - your-traefik-network
+    restart: unless-stopped