-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
403 lines (381 loc) · 12.9 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
403 lines (381 loc) · 12.9 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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# Development Docker Compose
# For local development with hot-reload
services:
# Frontend
frontend:
build:
context: ./apps/frontend
# use Dockerfile.dev (exists) for development build
dockerfile: Dockerfile.dev
ports:
- "5173:5173"
volumes:
- ./apps/frontend/src:/app/src:z
- ./apps/frontend/public:/app/public:z
- ./apps/frontend/index.html:/app/index.html:z
- ./apps/frontend/vite.config.ts:/app/vite.config.ts:z
- ./apps/frontend/tsconfig.json:/app/tsconfig.json:z
- ./apps/frontend/tsconfig.node.json:/app/tsconfig.node.json:z
- ./apps/frontend/package.json:/app/package.json:z
- ./apps/frontend/postcss.config.js:/app/postcss.config.js:z
- ./apps/frontend/tailwind.config.js:/app/tailwind.config.js:z
- ./apps/frontend/vitest.config.ts:/app/vitest.config.ts:z
- ./apps/frontend/vite.config.d.ts:/app/vite.config.d.ts:z
- /app/node_modules
environment:
- VITE_GATEWAY_URL=http://gateway:4000
- VITE_NOTIFICATION_URL=http://notification-service:8082
- VITE_BASE_URL=http://localhost
depends_on:
- gateway
# Webshop
webshop:
build:
context: ./apps/webshop
dockerfile: Dockerfile.dev
ports:
- "5174:3008"
volumes:
- ./apps/webshop/src:/app/src:z
- ./apps/webshop/index.html:/app/index.html:z
- ./apps/webshop/vite.config.ts:/app/vite.config.ts:z
- ./apps/webshop/tsconfig.json:/app/tsconfig.json:z
- ./apps/webshop/tsconfig.node.json:/app/tsconfig.node.json:z
- ./apps/webshop/package.json:/app/package.json:z
- ./apps/webshop/postcss.config.js:/app/postcss.config.js:z
- ./apps/webshop/tailwind.config.js:/app/tailwind.config.js:z
- /app/node_modules
environment:
- VITE_GATEWAY_URL=http://gateway:4000
depends_on:
- gateway
# Gateway
gateway:
build:
context: ./apps/gateway
dockerfile: Dockerfile.dev
ports:
- "4000:4000"
volumes:
- ./apps/gateway/src:/app/src:z
- ./apps/gateway/supergraph-config.yaml:/app/supergraph-config.yaml:z
- ./apps/gateway/supergraph.graphql:/app/supergraph.graphql:z
environment:
- NODE_ENV=development
- DEBUG=apollo:gateway
- USER_SERVICE_URL=http://user-service:5000/graphql/
- TRANSLATION_SERVICE_URL=http://translation-service:8081/graphql
- COMPANY_SERVICE_URL=http://company-service:8080/graphql
- SHOP_SERVICE_URL=http://shop-service:5003/graphql/
- ACCOUNTING_SERVICE_URL=http://accounting-service:5001/graphql/
- MASTERDATA_SERVICE_URL=http://masterdata-service:5002/graphql/
- ORDERS_SERVICE_URL=http://orders-service:5004/graphql/
- NOTIFICATION_SERVICE_URL=http://notification-service:8082/graphql
depends_on:
- user-service
- company-service
- translation-service
- accounting-service
- masterdata-service
- notification-service
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# .NET Services
user-service:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
ports:
- "5000:5000"
volumes:
# :z relabels the bind mount for SELinux-enforcing hosts (e.g. Fedora)
- ./apps/services/dotnet/UserService:/app:z
- ./apps/services/dotnet/Common:/Common:z
working_dir: /app
command: dotnet run --urls http://0.0.0.0:5000
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Host=postgres;Database=userdb;Username=erp_user;Password=postgres
- Jwt__Key=your-super-secret-key-at-least-256-bits-long-for-hs256
- Jwt__Issuer=ERP_System
- Jwt__Audience=ERP_System
- Services__Company=http://company-service:8080/graphql
depends_on:
postgres:
condition: service_healthy
shop-service:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
ports:
- "5003:5003"
volumes:
- ./apps/services/dotnet/ShopService:/app:z
- ./apps/services/dotnet/Common:/Common:z
working_dir: /app
command: dotnet run --urls http://0.0.0.0:5003
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Host=postgres;Database=shopdb;Username=erp_shop;Password=postgres
- Jwt__Key=your-super-secret-key-at-least-256-bits-long-for-hs256
- Jwt__Issuer=ERP_System
- Jwt__Audience=ERP_System
- Services__TemplatesService=http://templates-service:8087
depends_on:
postgres:
condition: service_healthy
accounting-service:
build:
context: ./apps/services/dotnet
dockerfile: AccountingService/Dockerfile
# Uses the final image stage from the Dockerfile (runs the published app)
target: final
ports:
- "5001:5001"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:5001
- ConnectionStrings__DefaultConnection=Host=postgres;Database=accountingdb;Username=erp_accounting;Password=postgres
- Jwt__Key=your-super-secret-key-at-least-256-bits-long-for-hs256
- Jwt__Issuer=ERP_System
- Jwt__Audience=ERP_System
depends_on:
postgres:
condition: service_healthy
masterdata-service:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
ports:
- "5002:5002"
volumes:
- ./apps/services/dotnet/MasterdataService:/app:z
- ./apps/services/dotnet/Common:/Common:z
working_dir: /app
command: dotnet run --urls http://0.0.0.0:5002
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Host=postgres;Database=masterdatadb;Username=erp_masterdata;Password=postgres
- Jwt__Key=your-super-secret-key-at-least-256-bits-long-for-hs256
- Jwt__Issuer=ERP_System
- Jwt__Audience=ERP_System
depends_on:
postgres:
condition: service_healthy
orders-service:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
ports:
- "5004:5004"
volumes:
- ./apps/services/dotnet/OrdersService:/app:z
- ./apps/services/dotnet/Common:/Common:z
working_dir: /app
command: dotnet run --urls http://0.0.0.0:5004
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Host=postgres;Database=ordersdb;Username=erp_orders;Password=postgres
- Jwt__Key=your-super-secret-key-at-least-256-bits-long-for-hs256
- Jwt__Issuer=ERP_System
- Jwt__Audience=ERP_System
depends_on:
postgres:
condition: service_healthy
# Java Services
company-service:
build:
context: ./apps/services/java/company-service
# use default Dockerfile in company-service
ports:
- "8080:8080"
volumes:
- ./apps/services/java/company-service:/app:z
- /app/.gradle
- /app/build
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/companydb
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=companydb
- DB_USER=erp_company
- DB_PASSWORD=postgres
depends_on:
postgres:
condition: service_healthy
notification-service:
build:
context: ./apps/services/java/notification-service
# use default Dockerfile in notification-service
ports:
- "8082:8082"
volumes:
- ./apps/services/java/notification-service:/app:z
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/notificationdb
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=notificationdb
- DB_USER=erp_notification
- DB_PASSWORD=postgres
# SMTP Configuration (loaded from .env file)
- SMTP_HOST=${SMTP_HOST:-smtp.ionos.de}
- SMTP_PORT=${SMTP_PORT:-587}
- SMTP_USERNAME=${SMTP_USERNAME:-}
- SMTP_PASSWORD=${SMTP_PASSWORD:-}
- EMAIL_FROM=${EMAIL_FROM:-}
- EMAIL_FROM_NAME=${EMAIL_FROM_NAME:-ERP System}
depends_on:
postgres:
condition: service_healthy
# Build from source with compatible dependencies
translation-service:
build:
context: ./apps/services/java/translation-service
dockerfile: Dockerfile.build
ports:
- "8081:8081"
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_CACHE_TYPE=none
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/translationdb
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=translationdb
- DB_USER=erp_translation
- DB_PASSWORD=postgres
depends_on:
postgres:
condition: service_healthy
networks:
- default
restart: unless-stopped
scripting-service:
build:
context: ./apps/services/java/scripting-service
ports:
- "8083:8083"
environment:
- SPRING_PROFILES_ACTIVE=dev
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=scriptingdb
- DB_USER=erp_scripting
- DB_PASSWORD=postgres
- GATEWAY_URL=http://gateway:4000
- MASTERDATA_SERVICE_URL=http://masterdata-service:5002
- SHOP_SERVICE_URL=http://shop-service:5003
- ACCOUNTING_SERVICE_URL=http://accounting-service:5001
- USER_SERVICE_URL=http://user-service:5000
- COMPANY_SERVICE_URL=http://company-service:8080
depends_on:
postgres:
condition: service_healthy
networks:
- default
restart: unless-stopped
templates-service:
build:
context: ./apps/services/nodejs/templates-service
ports:
- "8087:8087"
volumes:
- ./apps/services/nodejs/templates-service:/app:z
- /app/node_modules
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://erp_templates:postgres@postgres:5432/templatesdb
- DEFAULT_COMPANY_ID=ae161374-7185-4aa5-97f4-bcb35cf0ae19
depends_on:
postgres:
condition: service_healthy
# PostgreSQL Database (consolidated single instance)
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# DB_PASSWORD is used by init-multi-db.sh to set passwords for all service users
DB_PASSWORD: postgres
# Passwords for per-service users (defaults for development)
ERP_USER_PASSWORD: postgres
ERP_SHOP_PASSWORD: postgres
ERP_ACCOUNTING_PASSWORD: postgres
ERP_MASTERDATA_PASSWORD: postgres
ERP_ORDERS_PASSWORD: postgres
ERP_COMPANY_PASSWORD: postgres
ERP_NOTIFICATION_PASSWORD: postgres
ERP_TRANSLATION_PASSWORD: postgres
ERP_TEMPLATES_PASSWORD: postgres
ERP_SCRIPTING_PASSWORD: postgres
ports:
- "15432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
# :z relabels the bind mount for SELinux-enforcing hosts (e.g. Fedora)
- ./infrastructure/postgres-init:/docker-entrypoint-initdb.d:ro,z
healthcheck:
# pg_isready alone returns true before init-multi-db.sh finishes.
# Adding a SELECT on pg_roles ensures all service users are created
# before downstream services try to connect.
test: ["CMD-SHELL", "pg_isready -U postgres && psql -U postgres -d postgres -c \"SELECT 1 FROM pg_roles WHERE rolname = 'erp_user'\" | grep -q 1"]
interval: 5s
timeout: 5s
retries: 20
start_period: 30s
# MinIO (S3-compatible storage for documents)
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
MINIO_PROMETHEUS_AUTH_TYPE: public
MINIO_BROWSER: "on"
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
# Observability
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
# :z relabels the bind mount for SELinux-enforcing hosts (e.g. Fedora)
- ./infrastructure/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro,z
- prometheus-data:/prometheus
grafana:
image: grafana/grafana:latest
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
volumes:
# :z relabels the bind mount for SELinux-enforcing hosts (e.g. Fedora)
- ./infrastructure/grafana/provisioning:/etc/grafana/provisioning:z
- grafana-data:/var/lib/grafana
portainer:
image: portainer/portainer-ce:latest
ports:
- "9443:9443"
- "9002:9000" # Changed from 9000 to avoid conflict with MinIO
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
restart: always
volumes:
postgres-data:
minio-data:
prometheus-data:
grafana-data:
portainer_data:
networks:
default:
name: erp-network