traefik/docker-compose.yml

44 lines
1.3 KiB
YAML
Raw Normal View History

2024-05-03 20:37:56 +00:00
version: '3'
services:
traefik:
image: traefik:latest
container_name: "traefik"
restart: always
ports:
- "8888:80"
- "8443:443"
2024-05-14 17:15:18 +00:00
command:
- --configFile=/traefik.yml
2024-05-03 21:16:58 +00:00
networks:
- web
- default
2024-05-03 21:03:00 +00:00
#env_file:
# - './conf/.ovh-api.env'
2024-05-03 20:37:56 +00:00
volumes:
# Mapping sur le socket interne de Docker
- '/var/run/docker.sock:/var/run/docker.sock'
# Mapping du fichier de configuration statique
2024-05-14 19:06:01 +00:00
- '/volume1/docker/traefik/conf/traefik.yml:/etc/traefik/traefik.yml'
2024-05-03 20:37:56 +00:00
# Mapping du dossier contenant la configuration dynamique
#- './conf/dyn_traefik/:/dyn_traefik/'
# Mapping du fichier de stockage des certificats
#- './conf/acme.json:/acme.json'
labels:
- "traefik.enable=true"
2024-05-04 16:38:08 +00:00
- "traefik.http.routers.api.rule=Path(/api) "
- "traefik.http.routers.api.service=api@internal"
2024-05-04 16:36:40 +00:00
#- "traefik.http.routers.api.middlewares=auth"
#- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
2024-05-03 21:16:58 +00:00
whoami:
# A container that exposes an API to show its IP address
image: traefik/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
2024-05-03 21:17:55 +00:00
networks:
web:
external: true