-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
68 lines (61 loc) · 2.2 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
56
57
58
59
60
61
62
63
64
65
66
67
68
version: '3'
services:
reverse-proxy:
image: traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./certs:/etc/traefik/certificates
- ./config/traefik.yaml:/etc/traefik/traefik.yaml
static-server:
image: static-html-nginx
build: ./Static-server
labels:
- "traefik.enable=true"
# Redirige les requêtes http
- "traefik.http.routers.static-server-http.rule=Host(`localhost`)"
- "traefik.http.routers.static-server-http.entrypoints=http"
# Redirige les requêtes https
- "traefik.http.routers.static-server.tls=true"
- "traefik.http.routers.static-server.rule=Host(`localhost`)"
- "traefik.http.routers.static-server.entrypoints=https"
deploy:
replicas: 3
foosball-api:
image: foosball-api
build: ./foosball-api
labels:
- "traefik.enable=true"
# Active la sticky-session
- "traefik.http.services.foosball-api.loadbalancer.sticky.cookie=true"
- "traefik.http.services.foosball-api.loadbalancer.sticky.cookie.name=my-sticky-cookie"
# Redirige les requêtes http pour l'API
- "traefik.http.routers.foosball-api-http.rule=Host(`localhost`) && PathPrefix(`/api`)"
- "traefik.http.routers.foosball-api-http.entrypoints=http"
# Redirige les requêtes https
- "traefik.http.routers.foosball-api.tls=true"
- "traefik.http.routers.foosball-api.rule=Host(`localhost`) && PathPrefix(`/api`)"
- "traefik.http.routers.foosball-api.entrypoints=https"
# Redirige les requêtes vers le port 7000
- "traefik.http.services.foosball-api.loadbalancer.server.port=7000"
deploy:
replicas: 3
portainer:
image: portainer/portainer-ce
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.rule=Host(`portainer.localhost`)"
- "traefik.http.routers.portainer.entrypoints=https"
- "traefik.http.routers.portainer.tls=true"
- "traefik.http.routers.portainer-http.entrypoints=http"
volumes:
portainer_data: