From ffaa7aeb808c1db3594b5ad1989e20d2154d547c Mon Sep 17 00:00:00 2001 From: daltux <1medinnz@duck.com> Date: Thu, 4 Sep 2025 19:00:34 -0300 Subject: 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. --- examples/docker-swarm-traefik/traefik_config.yml | 89 ++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 examples/docker-swarm-traefik/traefik_config.yml (limited to 'examples/docker-swarm-traefik/traefik_config.yml') 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" -- cgit