-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
57 lines (53 loc) · 1.45 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
# docker network create --driver overlay --scope swarm proxy
version: "3.2"
services:
reverse-proxy:
image: traefik:latest # The official Traefik docker image
command:
- "--web" # Enables the web UI
- "--docker" # Tells Træfik to listen to docker
- "--docker.watch"
- "--docker.swarmMode"
- "--entrypoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entrypoints=Name:https Address::443 TLS"
- "--defaultentrypoints=http,https"
- "--loglevel=DEBUG"
ports:
- "80:80" # The HTTP port
- "443:443" # The HTTPS port
- "8181:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
networks:
- proxy
deploy:
mode: global
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
tinyweb:
image: cyd01/tinyweb
volumes:
- tinyweb_data:/www
networks:
- proxy
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == worker]
labels:
- "traefik.backend=tinyweb"
- "traefik.frontend.rule=PathPrefixStrip:/"
- "traefik.docker.network=proxy"
- "traefik.port=9999"
volumes:
tinyweb_data:
networks:
proxy:
external: true