53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
| # docker-compose.yml
 | |
| version: '3'
 | |
| 
 | |
| services:
 | |
|   reverse-proxy:
 | |
|     image: traefik:v2.6
 | |
|     container_name: traefik
 | |
|     security_opt:
 | |
|       - no-new-privileges:true
 | |
|     ports:
 | |
|       # Web
 | |
|       - 80:80
 | |
|       - 443:443
 | |
|     volumes:
 | |
|       - /var/run/docker.sock:/var/run/docker.sock:ro
 | |
|       # On map la conf statique dans le conteneur
 | |
|       - ./traefik.yml:/etc/traefik/traefik.yml:ro
 | |
|       # On map la conf dynamique statique dans le conteneur
 | |
|       - ./config.yml:/etc/traefik/config.yml:ro
 | |
|       # On map les certificats dans le conteneur
 | |
|       - ./certs:/etc/certs:ro
 | |
|     networks:
 | |
|       - gateway
 | |
|     labels:
 | |
|       # Permettre à ce conteneur d'être accessible par traefik
 | |
|       # Pour plus d'information, voir : https://docs.traefik.io/providers/docker/#exposedbydefault
 | |
|       - "traefik.enable=true"
 | |
|       # Utilise la configuration du routeur "traefik" définie dans le fichier de configuration dynamique : ./traefik/config.yml
 | |
|       - "traefik.http.routers.traefik=true"
 | |
| 
 | |
|   whoami:
 | |
|     image: containous/whoami
 | |
|     container_name: whoami
 | |
|     security_opt:
 | |
|       - no-new-privileges:true
 | |
|     labels:
 | |
|       - "traefik.enable=true"
 | |
|       - "traefik.http.routers.whoami.rule=Host(`whoami.combava.lan`)"
 | |
|       - "traefik.http.routers.whoami.tls=true"
 | |
|       - "traefik.http.routers.whoami.entrypoints=https"
 | |
|       # Si le port est différent de 80, utilisez le service suivant:
 | |
|       # - "traefik.http.services.<service_name>.loadbalancer.server.port=<port>"
 | |
|       - traefik.http.services.whoami.loadbalancer.server.port=80
 | |
|     networks:
 | |
|       - gateway
 | |
| 
 | |
| 
 | |
| networks:
 | |
|   gateway:
 | |
|     external: true
 | |
| 
 | |
| 
 |