-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdocker-compose-traefik.yml
executable file
·39 lines (39 loc) · 1.31 KB
/
docker-compose-traefik.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
version: '3.5'
services:
#---------#
# Traefik #
#---------#
# - a HTTP reverse proxy and load balancer that makes deploying microservices easy.
# - integrates with the existing infrastructure components (Docker, Swarm mode, Kubernetes, etc.,) and configures automatically and dynamically
traefik:
container_name: traefik.local
image: traefik:v3.0
command:
# Enable Docker provider
- "--providers.docker=true"
# Do not expose containers unless explicitly told so (e.g., traefik.enable=true)
- "--providers.docker.exposedbydefault=false"
- "--log.format=common"
- "--log.level=INFO"
- "--log.filePath=/var/log/traefik.log"
# Listen to incoming request on the port 80 (HTTP)
- "--entryPoints.http.address=:80"
- "--api=true"
# Listen on port 8080 by default for API requests
- "--api.insecure=true"
- "--api.dashboard=true"
ports:
# load balancer port
- 16060:80
# UI management port
- 26060:8080
labels:
- traefik.http.routers.traefik.rule=Host(`localhost`)
networks:
- ecommerce-network
volumes:
# scan all running containers on the Docker socket (i.e., auto service discovery)
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
ecommerce-network:
name: ecommerce-app