traefik/docker-compose.yml
2024-05-14 19:15:18 +02:00

44 lines
1.3 KiB
YAML

version: '3'
services:
traefik:
image: traefik:latest
container_name: "traefik"
restart: always
ports:
- "8888:80"
- "8443:443"
command:
- --configFile=/traefik.yml
networks:
- web
- default
#env_file:
# - './conf/.ovh-api.env'
volumes:
# Mapping sur le socket interne de Docker
- '/var/run/docker.sock:/var/run/docker.sock'
# Mapping du fichier de configuration statique
- '/volume1/docker/traefik/conf/traefik.yml:/traefik.yml'
# 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"
- "traefik.http.routers.api.rule=Path(/api) "
- "traefik.http.routers.api.service=api@internal"
#- "traefik.http.routers.api.middlewares=auth"
#- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
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`)"
networks:
web:
external: true