-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-autodisc.yaml
68 lines (64 loc) · 1.86 KB
/
docker-compose-autodisc.yaml
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
# RUN WITH
# docker-compose up --scale add-sub=4 --scale mult-div=3
version: "3.3"
services:
traefik:
image: "traefik"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=true"
- "--entrypoints.web.address=:80"
- "--ping"
ports:
- "3030:80"
- "3031:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
# - "./traefik.yml:/etc/traefik/traefik.yml:ro"
# - "./all.yml:/etc/traefik/all.yml:ro"
labels:
- "traefik.enable=true"
# - "traefik.docker.network=if4031-traefik_default"
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
networks:
- default
add-sub:
image: "alvinwilta/add-sub"
environment:
- SERVER_HOSTNAME=localhost
- SERVER_PORT=30
expose:
- 30
command: npm start
labels:
- "traefik.http.routers.add-sub-router.service=add-sub"
- "traefik.http.routers.add-sub-router.entrypoints=web"
- "traefik.http.services.add-sub.loadbalancer.server.port=30"
- "traefik.docker.network=if4031-traefik_default"
- "traefik.http.routers.add-sub.rule=Host(`add.localhost`)"
networks:
- default
mult-div:
image: "alvinwilta/mult-div"
environment:
- hostname=localhost
- port=31
expose:
- 31
command: npm start
labels:
- "traefik.http.routers.mult-div-router.service=mult-div"
- "traefik.http.routers.mult-div-router.entrypoints=web"
- "traefik.http.services.mult-div.loadbalancer.server.port=31"
- "traefik.docker.network=if4031-traefik_default"
- "traefik.http.routers.mult-div.rule=Host(`mult.localhost`)"
networks:
- default
networks:
default:
driver: "bridge"
name: "if4031-traefik_default"