-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod-local.yml
More file actions
361 lines (345 loc) · 10.8 KB
/
docker-compose.prod-local.yml
File metadata and controls
361 lines (345 loc) · 10.8 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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# Local Production Test Configuration
# Builds images locally and runs in production mode
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
# ==========================================================================
# Database
# ==========================================================================
postgres:
image: postgres:16-alpine
container_name: erp-postgres
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-securepassword123}
volumes:
- postgres-data:/var/lib/postgresql/data
- ./infrastructure/postgres-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
logging: *default-logging
networks:
- erp-network
ports:
- "15432:5432"
# ==========================================================================
# .NET Services (Built Locally)
# ==========================================================================
user-service:
build:
context: ./apps/services/dotnet
dockerfile: UserService/Dockerfile
container_name: erp-user-service
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://*:5000
ConnectionStrings__DefaultConnection: Host=postgres;Port=5432;Database=userdb;Username=erp_user;Password=${DB_PASSWORD:-RaxhWee5Pei1e}
JWT__Secret: your-jwt-secret-key-here-make-it-long-and-secure-at-least-32-chars
JWT__Issuer: erp-system
JWT__Audience: erp-clients
Database__EnableSeeding: "true"
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "5000:5000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
shop-service:
build:
context: ./apps/services/dotnet
dockerfile: ShopService/Dockerfile
container_name: erp-shop-service
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://*:5003
ConnectionStrings__DefaultConnection: Host=postgres;Port=5432;Database=shopdb;Username=erp_shop;Password=${DB_PASSWORD:-RaxhWee5Pei1e}
Database__EnableSeeding: "true"
MINIO_ENDPOINT: minio:9000
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
MINIO_USE_SSL: "false"
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "5003:5003"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5003/health"]
interval: 30s
timeout: 10s
retries: 3
accounting-service:
build:
context: ./apps/services/dotnet
dockerfile: AccountingService/Dockerfile
container_name: erp-accounting-service
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://*:5001
ConnectionStrings__DefaultConnection: Host=postgres;Port=5432;Database=accountingdb;Username=erp_accounting;Password=${DB_PASSWORD:-RaxhWee5Pei1e}
Database__EnableSeeding: "true"
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "5001:5001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5001/health"]
interval: 30s
timeout: 10s
retries: 3
masterdata-service:
build:
context: ./apps/services/dotnet
dockerfile: MasterdataService/Dockerfile
container_name: erp-masterdata-service
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://*:5002
ConnectionStrings__DefaultConnection: Host=postgres;Port=5432;Database=masterdatadb;Username=erp_masterdata;Password=${DB_PASSWORD:-RaxhWee5Pei1e}
Database__EnableSeeding: "true"
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "5002:5002"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5002/health"]
interval: 30s
timeout: 10s
retries: 3
orders-service:
build:
context: ./apps/services/dotnet
dockerfile: OrdersService/Dockerfile
container_name: erp-orders-service
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://*:5004
ConnectionStrings__DefaultConnection: Host=postgres;Port=5432;Database=ordersdb;Username=erp_orders;Password=${DB_PASSWORD:-RaxhWee5Pei1e}
Database__EnableSeeding: "true"
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "5004:5004"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5004/health"]
interval: 30s
timeout: 10s
retries: 3
# ==========================================================================
# Java Services (Built Locally)
# ==========================================================================
company-service:
build:
context: ./apps/services/java/company-service
dockerfile: Dockerfile
container_name: erp-company-service
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/companydb
SPRING_DATASOURCE_USERNAME: erp_company
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD:-RaxhWee5Pei1e}
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
translation-service:
build:
context: ./apps/services/java/translation-service
dockerfile: Dockerfile
container_name: erp-translation-service
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/translationdb
SPRING_DATASOURCE_USERNAME: erp_translation
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD:-RaxhWee5Pei1e}
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "8081:8081"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8081/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
notification-service:
build:
context: ./apps/services/java/notification-service
dockerfile: Dockerfile
container_name: erp-notification-service
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/notificationdb
SPRING_DATASOURCE_USERNAME: erp_notification
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD:-RaxhWee5Pei1e}
SMTP_HOST: smtp.example.com
SMTP_PORT: 587
SMTP_USERNAME: no-reply@example.com
SMTP_PASSWORD: placeholder
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "8082:8082"
# ==========================================================================
# Node.js Services
# ==========================================================================
templates-service:
build:
context: ./apps/services/nodejs/templates-service
dockerfile: Dockerfile
container_name: erp-templates-service
environment:
NODE_ENV: production
PORT: 8087
DATABASE_URL: postgresql://erp_templates:postgres@postgres:5432/templatesdb
depends_on:
postgres:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "8087:8087"
# ==========================================================================
# Gateway
# ==========================================================================
gateway:
build:
context: ./apps/gateway
dockerfile: Dockerfile
container_name: erp-gateway
restart: on-failure
environment:
NODE_ENV: production
PORT: 4000
USER_SERVICE_URL: http://user-service:5000/graphql/
COMPANY_SERVICE_URL: http://company-service:8080/graphql
MASTERDATA_SERVICE_URL: http://masterdata-service:5002/graphql/
ACCOUNTING_SERVICE_URL: http://accounting-service:5001/graphql/
TRANSLATION_SERVICE_URL: http://translation-service:8081/graphql
SHOP_SERVICE_URL: http://shop-service:5003/graphql/
ORDERS_SERVICE_URL: http://orders-service:5004/graphql/
depends_on:
user-service:
condition: service_healthy
company-service:
condition: service_healthy
masterdata-service:
condition: service_healthy
accounting-service:
condition: service_healthy
translation-service:
condition: service_healthy
shop-service:
condition: service_healthy
orders-service:
condition: service_healthy
logging: *default-logging
networks:
- erp-network
ports:
- "4000:4000"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:4000/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
# ==========================================================================
# Frontend
# ==========================================================================
frontend:
build:
context: ./apps/frontend
dockerfile: Dockerfile
args:
VITE_API_URL: /graphql
VITE_SHOP_API_URL: /shop/graphql
container_name: erp-frontend
depends_on:
- gateway
logging: *default-logging
networks:
- erp-network
ports:
- "8088:80"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:80/health"]
interval: 30s
timeout: 10s
retries: 3
# ==========================================================================
# Infrastructure
# ==========================================================================
minio:
image: minio/minio:RELEASE.2024-01-16T16-07-38Z
container_name: erp-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
logging: *default-logging
networks:
- erp-network
ports:
- "9000:9000"
- "9001:9001"
networks:
erp-network:
driver: bridge
volumes:
postgres-data:
minio-data: