forked from RemiAncay/dai-lab-http-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
55 lines (49 loc) · 1.99 KB
/
docker-compose.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
version: '3'
services:
web:
build: ./static_web
deploy:
replicas: 3
labels:
- "traefik.enable=true" # Activation de Traefik pour ce service web
- "traefik.http.routers.static-web.rule=Host(`localhost`)" # Route pour le serveur web statique
- "traefik.http.services.static-web.loadbalancer.server.port=80" # Port du serveur web statique
- "traefik.http.routers.static-web.entrypoints=websecure"
- "traefik.http.routers.static-web.tls=true"
constellation-api:
build: ./api
deploy:
mode: replicated
replicas: 4
labels:
- "traefik.enable=true"
- "traefik.http.routers.constellation_api.rule=Host(`localhost`) && PathPrefix(`/api`)"
- "traefik.http.middlewares.constellation_api_stripprefix.stripprefix.prefixes=/api"
- "traefik.http.routers.constellation_api.middlewares=constellation_api_stripprefix"
- "traefik.http.services.constellation_api.loadbalancer.server.port=8000"
- "traefik.http.routers.constellation_api.entrypoints=websecure"
- "traefik.http.routers.constellation_api.tls=true"
## Sticky session
- "traefik.http.services.constellation_api.loadbalancer.sticky.cookie=true"
- "traefik.http.services.constellation_api.loadbalancer.sticky.cookie.name=constellation_api"
- "traefik.http.services.constellation_api.loadbalancer.sticky.cookie.secure=true" # For HTTPS
reverse_proxy:
image: traefik:v2.10 # Utilisation de l'image Docker de Traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./certs:/etc/traefik/certificates
- ./traefik/traefik.yaml:/etc/traefik/traefik.yaml
ports: # Mapping des ports du conteneur au ports de l'hôte
- "80:80" # Port HTTP
- "8080:8080" # Dashboard de Traefik
- "443:443"
portainer:
image: portainer/portainer-ce:latest
ports:
- 9443:9443
volumes:
- data:/data
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
volumes:
data: