-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (93 loc) · 2.36 KB
/
Copy pathdocker-compose.yml
File metadata and controls
100 lines (93 loc) · 2.36 KB
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
95
96
97
98
99
100
version: "3.9"
services:
users:
build:
context: .
dockerfile: users-service/Dockerfile
ports:
- "8001:8001"
volumes:
- users-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
products:
build:
context: .
dockerfile: products-service/Dockerfile
ports:
- "8002:8002"
volumes:
- products-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8002/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
inventory:
build:
context: .
dockerfile: inventory-service/Dockerfile
ports:
- "8003:8003"
volumes:
- inventory-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8003/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
orders:
build:
context: .
dockerfile: orders-service/Dockerfile
ports:
- "8004:8004"
volumes:
- orders-data:/data
environment:
USERS_SERVICE_URL: http://users:8001
PRODUCTS_SERVICE_URL: http://products:8002
INVENTORY_SERVICE_URL: http://inventory:8003
restart: unless-stopped
depends_on:
users:
condition: service_healthy
products:
condition: service_healthy
inventory:
condition: service_healthy
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8004/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
gateway:
build:
context: .
dockerfile: gateway/Dockerfile
ports:
- "8000:8000"
environment:
USERS_SERVICE_URL: http://users:8001
PRODUCTS_SERVICE_URL: http://products:8002
INVENTORY_SERVICE_URL: http://inventory:8003
ORDERS_SERVICE_URL: http://orders:8004
restart: unless-stopped
depends_on:
orders:
condition: service_healthy
volumes:
users-data:
products-data:
inventory-data:
orders-data: