Traefik
Compose file
services:
whoami:
image: traefik/whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.rule=Host(`whoami.example.com`)"
traefik:
image: traefik:v2.9
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
Steps
-
Change domain in
docker-compose.yml
to a domain pointing to your server -
Start all services
docker-compose up -d
-
Change
whoami
image to, for example,jwilder/whoami
-
Deploy new version of
whoami
service without downtimedocker rollout whoami