aboutsummaryrefslogtreecommitdiff
path: root/examples/docker-swarm-traefik/traefik_config.yml
diff options
context:
space:
mode:
authordaltux <1medinnz@duck.com>2025-09-04 19:00:34 -0300
committerdaltux <1medinnz@duck.com>2025-09-04 19:00:34 -0300
commitffaa7aeb808c1db3594b5ad1989e20d2154d547c (patch)
treea2466245854438bff8c8d50d2db4b51d2cfc2cfe /examples/docker-swarm-traefik/traefik_config.yml
parent4f5b49bc2476ab6986c3364aa0b88e0cc97040c4 (diff)
Examples: Docker Swarm with Traefik and container build script.
Example files for setting a complete SNAC + Traefik v3 stack on Docker Swarm mode, including Let's Encrypt certificates, HTTP security headers, and caching of */s/* (SNAC static files) for 24 hours with souin. A script for building the SNAC container with Docker and optionally pushing it to a registry.
Diffstat (limited to 'examples/docker-swarm-traefik/traefik_config.yml')
-rw-r--r--examples/docker-swarm-traefik/traefik_config.yml89
1 files changed, 89 insertions, 0 deletions
diff --git a/examples/docker-swarm-traefik/traefik_config.yml b/examples/docker-swarm-traefik/traefik_config.yml
new file mode 100644
index 0000000..045408c
--- /dev/null
+++ b/examples/docker-swarm-traefik/traefik_config.yml
@@ -0,0 +1,89 @@
+---
+# Traefik main config file
+# e.g. /opt/docker/traefik/traefik_config.yml
+
+entryPoints:
+ web:
+ address: ":80"
+ http:
+ encodeQuerySemicolons: true
+ redirections:
+ entryPoint:
+ to: websecure
+ scheme: https
+ permanent: true
+ websecure:
+ address: ":443"
+ asDefault: true
+ http:
+ encodeQuerySemicolons: true
+ tls:
+ certResolver: letsencrypt
+ http2:
+ maxConcurrentStreams: 100
+ http3: {}
+
+certificatesResolvers:
+ letsencrypt:
+ acme:
+ email: you@example.net
+ storage: "/acme/letsencrypt.json"
+ keyType: EC384
+ httpChallenge:
+ entryPoint: web
+# buypass:
+# acme:
+# email: you@example.net
+# caServer: "https://api.buypass.com/acme/directory"
+# storage: "/acme/buypass.json"
+# keyType: EC256
+# certificatesDuration: 4320
+# httpChallenge:
+# entryPoint: web
+
+ocsp: {}
+
+tls:
+ stores:
+ default:
+ defaultGeneratedCert:
+ resolver: letsencrypt
+ domain:
+ main: snac.example.net
+ # sans:
+ # - other.example.net
+ # - another.example.net
+
+providers:
+ file:
+ directory: "/etc/traefik/dynamic"
+ watch: true
+ swarm:
+ network: "proxy"
+ endpoint: "unix:///var/run/docker.sock"
+ exposedByDefault: false
+ watch: true
+ allowEmptyServices: true
+
+api:
+ dashboard: true
+ insecure: false
+ debug: false
+ disabledashboardad: true
+
+log:
+ level: "INFO"
+ filePath: "/var/log/server.log"
+
+accessLog:
+ filePath: "/var/log/traefik-access.log"
+ bufferingSize: 15
+ fields:
+ names:
+ StartUTC: "drop"
+
+experimental:
+ plugins:
+ souin:
+ moduleName: "github.com/darkweak/souin"
+ version: "v1.7.7"