Skip to content

Instantly share code, notes, and snippets.

@clintcolding
Created November 6, 2019 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save clintcolding/e3de0ebd70af457dc523492a8f71a477 to your computer and use it in GitHub Desktop.
Save clintcolding/e3de0ebd70af457dc523492a8f71a477 to your computer and use it in GitHub Desktop.
Traefik example
version: '3'
services:
whoami:
image: stefanscherer/whoami
labels:
# Create a router called whoami listening on the websecure entrypoint
- "traefik.http.routers.whoami.entrypoints=websecure"
# Force TLS
- "traefik.http.routers.whoami.tls=true"
# Apply a host rule specifying the domain the service will respond to
- "traefik.http.routers.whoami.rule=Host(`whoami.mydomain.com`)"
# Send traffic to the container via port 8080
- "traefik.http.services.whoami-service.loadbalancer.server.port=8080"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment