Skip to content

heyvaldemar/traefik-ssl-certificate-docker-swarm

Repository files navigation

Traefik with SSL Certificate in a Docker Swarm

Install Docker Swarm by following my guide.

Create a network for Traefik, config and secrets for storing the Traefik configuration, certificate and key on the Docker Swarm manager node before applying the configuration.

Create a network for Traefik using the command:

docker network create -d overlay traefik-network

Create a secret for storing the certificate using the command:

docker secret create wildcard-heyvaldemar-net.crt /path/to/wildcard-heyvaldemar-net.crt

Create a secret for storing the key using the command:

docker secret create wildcard-heyvaldemar-net.key /path/to/wildcard-heyvaldemar-net.key

Create a config for storing the Traefik configuration using the command:

docker config create traefik-dynamic-configuration.yml /path/to/traefik-dynamic-configuration.yml

Example of traefik-dynamic-configuration.yml:

tls:
  certificates:
    - certFile: /run/secrets/wildcard-heyvaldemar-net.crt
      keyFile: /run/secrets/wildcard-heyvaldemar-net.key

Deploy Traefik in a Docker Swarm using the command:

docker stack deploy -c traefik-ssl-certificate-docker-swarm.yml traefik

Author

I’m Vladimir Mikhalev, the Docker Captain, but my friends can call me Valdemar.

🌐 My website with detailed IT guides
🎬 Follow me on YouTube
🐦 Follow me on Twitter
🎨 Follow me on Instagram
🧵 Follow me on Threads
🐘 Follow me on Mastodon
🧊 Follow me on Bluesky
🎸 Follow me on Facebook
🎥 Follow me on TikTok
💻 Follow me on LinkedIn
🐈 Follow me on GitHub

Communication

👾 Chat with IT pros on Discord
📧 Reach me at ask@sre.gg

Give Thanks

💎 Support on GitHub
🏆 Support on Patreon
🥤 Support on BuyMeaCoffee
🍪 Support on Ko-fi
💖 Support on PayPal

About

Traefik with SSL Certificate in a Docker Swarm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published