-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
95 lines (84 loc) · 2.41 KB
/
docker-compose.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: "3.7"
services:
consul:
image: consul
command: consul agent -server -dev -client=0.0.0.0 -ui -bootstrap -log-level warn
ports:
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
registrator:
image: gliderlabs/registrator:latest
volumes:
- /var/run/docker.sock:/tmp/docker.sock
depends_on:
- consul
command: -internal consul://consul:8500
reverse-proxy:
image: traefik
command: --api --consulcatalog.endpoint=consul:8500
ports:
- 8080:8080
- 80:80
volumes:
- ./traefik.toml:/etc/traefik/traefik.toml
depends_on:
- registrator
rabbitmq:
image: "rabbitmq:3-management"
ports:
- "15672:15672"
- "5672:5672"
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "5672" ]
interval: 5s
timeout: 15s
retries: 1
inventory_db:
image: mongo
ports:
- "27017:27017"
inventory:
build:
context: ./inventory
expose:
- "5000"
environment:
- SERVICE_TAGS=traefik.enable=true,traefik.frontend.entryPoints=http,traefik.frontend.rule=Host:inventory.docker.localhost,traefik.backend=inventory,traefik.backend.circuitbreaker.expression=NetworkErrorRatio()>0.5
depends_on:
- rabbitmq
- inventory_db
users:
build:
context: ./users
expose:
- "5000"
environment:
- SERVICE_TAGS=traefik.enable=true,traefik.frontend.entryPoints=http,traefik.frontend.rule=Host:users.docker.localhost,traefik.backend=users,traefik.backend.circuitbreaker.expression=NetworkErrorRatio()>0.5
depends_on:
- rabbitmq
auth:
build:
context: ./auth
expose:
- "5000"
environment:
- SERVICE_TAGS=traefik.enable=true,traefik.frontend.entryPoints=http,traefik.frontend.rule=Host:auth.docker.localhost,traefik.backend=auth,traefik.backend.circuitbreaker.expression=NetworkErrorRatio()>0.5
depends_on:
- rabbitmq
orders:
build:
context: ./orders
expose:
- "5000"
environment:
- SERVICE_TAGS=traefik.enable=true,traefik.frontend.entryPoints=http,traefik.frontend.rule=Host:orders.docker.localhost,traefik.backend=orders,traefik.backend.circuitbreaker.expression=NetworkErrorRatio()>0.5
depends_on:
- order_db
- rabbitmq
order_db:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=root
- POSTGRES_DB=orders_micro