Traefik (Standalone Docker/Podman Host)
This directory contains the docker-compose.yml for a Traefik instance configured to run on a single Docker or Podman host. It acts as a reverse proxy and load balancer for services running on that specific host, utilizing the local docker.sock for provider discovery.
Running with Podman Compose
To run this Traefik instance using podman-compose:
- Navigate to this directory:
cd optimized/standalone/Traefik_Standalone - Important: Replace
DUCKDNS_TOKENplaceholder with your actual DuckDNS token in thedocker-compose.yml. - Ensure the
./letsencryptdirectory exists and has appropriate permissions for ACME certificate storage. - Ensure
traefik_dynamic.ymlexists and contains your dynamic configurations. - Start the services:
podman-compose up -d
Running with Podman
You can run Traefik directly with Podman. Due to the extensive command-line arguments and volume mounts, using podman-compose is generally recommended for this setup.
A simplified podman run example for Traefik (you would need to adapt the command arguments and volumes fully):
podman run -d \
--name traefik \
--restart unless-stopped \
-e DUCKDNS_TOKEN="YOUR_DUCKDNS_TOKEN" \
-p "80:80" -p "443:443" -p "8089:8089" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v ./letsencrypt:/letsencrypt \
-v ./traefik_dynamic.yml:/etc/traefik/traefik_dynamic.yml:ro \
traefik:latest \
--api.insecure=false \
--api.dashboard=true \
--entrypoints.web.address=:80 \
--entrypoints.websecure.address=:443 \
--entrypoints.dashboard.address=:8089 \
--providers.docker=true \
--providers.docker.endpoint=unix:///var/run/docker.sock \
--providers.docker.exposedbydefault=false \
--providers.file.filename=/etc/traefik/traefik_dynamic.yml \
--providers.file.watch=true \
--certificatesresolvers.duckdns.acme.email=your@email.com \
--certificatesresolvers.duckdns.acme.storage=/letsencrypt/acme.json \
--certificatesresolvers.duckdns.acme.dnschallenge.provider=duckdns \
--certificatesresolvers.duckdns.acme.dnschallenge.disablepropagationcheck=true
Notes
- This Traefik instance is for a single host. Your Swarm environment will have its own Traefik instance for cluster-wide routing.
- Ensure that
traefik_dynamic.ymland theletsencryptdirectory are correctly configured and persistent. - The
whoamiservice is a simple test service and will be automatically discovered by Traefik if correctly configured.