traefik/examples/quickstart/docker-compose.yml

19 lines
653 B
YAML
Raw Normal View History

2018-03-22 12:34:03 +01:00
version: '3'
services:
2018-10-17 16:24:04 +02:00
# The reverse proxy service (Traefik)
2018-03-22 12:34:03 +01:00
reverse-proxy:
2018-08-01 12:22:03 +03:00
image: traefik # The official Traefik docker image
2018-10-17 16:24:04 +02:00
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
2018-03-22 12:34:03 +01:00
ports:
2018-08-01 12:22:03 +03:00
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
2018-03-22 12:34:03 +01:00
volumes:
2018-08-01 12:22:03 +03:00
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
2018-03-22 12:34:03 +01:00
2018-08-01 12:22:03 +03:00
# A container that exposes a simple API
2018-03-22 12:34:03 +01:00
whoami:
2018-11-19 16:40:03 +01:00
image: emilevauge/whoami # A container that exposes an API to show its IP address
2018-03-22 12:34:03 +01:00
labels:
2018-08-01 12:22:03 +03:00
- "traefik.frontend.rule=Host:whoami.docker.localhost"