forked from badass-techie/eShopOnSteroids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
169 lines (154 loc) · 3.34 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
version: '3.8'
services:
zipkin:
image: openzipkin/zipkin-slim:2.24.2
restart: unless-stopped
ports:
- "9411:9411"
rabbitmq:
image: rabbitmq:3
restart: unless-stopped
volumes:
- rabbitmq-data:/var/lib/rabbitmq
discovery-server:
image: hashicorp/consul:1.16
command: ["consul", "agent", "-dev", "-client", "0.0.0.0"]
restart: unless-stopped
ports:
- "8500:8500"
api-gateway:
build:
context: .
dockerfile: Dockerfile
target: api-gateway
image: badasstechie/eshoponsteroids-api-gateway
restart: on-failure
ports:
- "8080:8080"
env_file:
- .env
depends_on:
- discovery-server
cart-db:
image: redis:7.2.1
restart: unless-stopped
volumes:
- cart-db:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
cart:
build:
context: .
dockerfile: Dockerfile
target: cart
image: badasstechie/eshoponsteroids-cart
restart: on-failure
env_file:
- .env
depends_on:
- cart-db
identity-db:
image: postgres:16.0
restart: unless-stopped
volumes:
- identity-db:/var/lib/postgresql/data
env_file:
- .env
environment:
- POSTGRES_USER=$IDENTITY_DB_USERNAME
- POSTGRES_PASSWORD=$IDENTITY_DB_PASSWORD
- POSTGRES_DB=identity
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 1s
timeout: 3s
retries: 30
identity:
build:
context: .
dockerfile: Dockerfile
target: identity
image: badasstechie/eshoponsteroids-identity
restart: on-failure
env_file:
- .env
depends_on:
- identity-db
order-db:
image: postgres:16.0
restart: unless-stopped
volumes:
- order-db:/var/lib/postgresql/data
env_file:
- .env
environment:
- POSTGRES_USER=$ORDER_DB_USERNAME
- POSTGRES_PASSWORD=$ORDER_DB_PASSWORD
- POSTGRES_DB=order
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 1s
timeout: 3s
retries: 30
order:
build:
context: .
dockerfile: Dockerfile
target: order
image: badasstechie/eshoponsteroids-order
restart: on-failure
env_file:
- .env
depends_on:
- order-db
- rabbitmq
product-db:
image: mongo:5.0-focal
restart: unless-stopped
volumes:
- product-db:/data/db
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
interval: 1s
timeout: 3s
retries: 30
product:
build:
context: .
dockerfile: Dockerfile
target: product
image: badasstechie/eshoponsteroids-product
restart: on-failure
env_file:
- .env
depends_on:
- product-db
- rabbitmq
prometheus:
image: prom/prometheus:v2.47.2
restart: unless-stopped
volumes:
- ./prometheus/prometheus-docker.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
grafana:
image: grafana/grafana:10.1.5
restart: unless-stopped
volumes:
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
environment:
- GF_LOG_LEVEL=warn
depends_on:
- prometheus
volumes:
rabbitmq-data:
cart-db:
identity-db:
order-db:
product-db:
grafana-data: