traefik-vs-nginx-docker/docker-compose.traefik.yml

29 lines
624 B
YAML
Raw Permalink Normal View History

2021-01-20 10:44:42 +00:00
version: '3.4'
services:
traefik:
image: 'traefik:2.3'
container_name: 'traefik'
restart: 'unless-stopped'
ports:
- '80:80'
- '8080:8080'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
- ./traefik/traefik.toml:/traefik.toml
networks:
- pi
whoami:
image: 'traefik/whoami'
restart: 'unless-stopped'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.whoami.rule=PathPrefix(`/whoami{regex:$$|/.*}`)'
- 'traefik.http.services.whoami.loadbalancer.server.port=80'
networks:
- pi
networks:
pi:
external: true