-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstack.yml
45 lines (42 loc) · 1.5 KB
/
stack.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
version: "3.9"
services:
traefik:
image: traefik:v2.7.0
ports:
- "80:80"
- "8080:8080" # traefik dashboard
command:
- --api.insecure=true # set to 'false' on production
- --api.dashboard=true # see https://docs.traefik.io/v2.0/operations/dashboard/#secure-mode for how to secure the dashboard
- --api.debug=true # enable additional endpoints for debugging and profiling
- --log.level=DEBUG # debug while we get it working, for more levels/info see https://docs.traefik.io/observability/logs/
- --providers.docker=true
- --providers.docker.swarmMode=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=proxy
- --entrypoints.web.address=:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy
deploy:
placement:
constraints:
- node.role == manager
worker:
image: lexxito/wodockersample:jetty9.4.46-jre11
hostname: "{{.Service.Name}}-{{.Task.Slot}}"
networks:
- proxy
deploy:
replicas: 4
labels:
- "traefik.enable=true"
- "traefik.http.routers.worker.rule=Host(`127.0.0.1`) || Host(`localhost`)"
- "traefik.http.routers.worker.entrypoints=web"
- "traefik.http.services.worker.loadbalancer.server.port=8080"
- "traefik.http.services.worker.loadbalancer.sticky=true"
- "traefik.http.services.worker.loadbalancer.sticky.cookie.name=StickyCookie"
networks:
proxy:
# external: true