Skip to content

Instantly share code, notes, and snippets.

@socheatsok78
Created September 12, 2024 10:13
Show Gist options
  • Save socheatsok78/b4255cec32dcfe1e79f0877d689d07b7 to your computer and use it in GitHub Desktop.
Save socheatsok78/b4255cec32dcfe1e79f0877d689d07b7 to your computer and use it in GitHub Desktop.
services:
my-container:
networks:
# Attach the service to the traefik-public network
traefik-public:
deploy:
labels:
# Enable Traefik for this service
- traefik.enable=true
- traefik.http.routers.my-container.rule=Host(`example.com`)
- traefik.http.services.my-container-service.loadbalancer.server.port=8080
# Enable TLS (optional)
- traefik.http.routers.my-container.tls=true
- traefik.http.routers.my-container.tls.certresolver=letsencrypt # or letsencrypt-staging
# Define the traefik-public network
networks:
traefik-public:
name: traefik-public
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment