-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
163 lines (153 loc) · 4.27 KB
/
docker-compose.yaml
File metadata and controls
163 lines (153 loc) · 4.27 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
# Shared Infrastructure for GoApps Local Development
# Usage: docker compose up -d
# This starts ALL infrastructure needed by all services (IAM, Finance, etc).
name: goapps-infra
services:
# PostgreSQL for IAM Service
iam-postgres:
image: postgres:18-alpine
container_name: goapps-iam-postgres
ports:
- "5435:5432"
environment:
POSTGRES_DB: iam_db
POSTGRES_USER: iam
POSTGRES_PASSWORD: iam123
volumes:
- iam_postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U iam -d iam_db" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- goapps
# PostgreSQL for Finance Service
finance-postgres:
image: postgres:18-alpine
container_name: goapps-finance-postgres
ports:
- "5434:5432"
environment:
POSTGRES_DB: finance_db
POSTGRES_USER: finance
POSTGRES_PASSWORD: finance123
volumes:
- finance_postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U finance -d finance_db" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- goapps
# Shared Redis (used by both IAM and Finance)
# IAM uses DB 1 (sessions, blacklist, OTP, rate limit)
# Finance uses DB 0 (UOM cache) and reads DB 1 (token blacklist)
redis:
image: redis:7-alpine
container_name: goapps-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- goapps
# Mailpit - Email Testing (SMTP + Web UI)
# SMTP: localhost:1025 | Web UI: http://localhost:8025
mailpit:
image: axllent/mailpit:latest
container_name: goapps-mailpit
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
environment:
MP_SMTP_AUTH_ACCEPT_ANY: "true"
MP_SMTP_AUTH_ALLOW_INSECURE: "true"
networks:
- goapps
# Jaeger - Distributed Tracing
# UI: http://localhost:16686
jaeger:
image: jaegertracing/all-in-one:1.55
container_name: goapps-jaeger
ports:
- "16686:16686" # Jaeger UI
- "14268:14268" # Collector HTTP
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
- COLLECTOR_OTLP_ENABLED=true
networks:
- goapps
# RabbitMQ - Message Queue for async job processing
# Management UI: http://localhost:15672 (guest/guest)
# AMQP: localhost:5672
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: goapps-rabbitmq
ports:
- "5672:5672" # AMQP
- "15672:15672" # Management UI
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "-q", "ping" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- goapps
# Shared MinIO - S3-compatible Object Storage
# API: localhost:9000 | Console: http://localhost:9001
# All services share one bucket (goapps-staging), scoped by STORAGE_BASE_PATH:
# IAM → goapps-staging/iam/...
# Finance → goapps-staging/finance/...
minio:
image: minio/minio:latest
container_name: goapps-minio
ports:
- "9000:9000" # S3 API
- "9001:9001" # Console Web UI
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: [ "CMD", "mc", "ready", "local" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- goapps
# Auto-create shared bucket on startup
minio-init:
image: minio/mc:latest
container_name: goapps-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c " mc alias set local http://minio:9000 minioadmin minioadmin; mc mb --ignore-existing local/goapps-staging; mc anonymous set download local/goapps-staging; echo 'Bucket goapps-staging created with public read policy'; "
networks:
- goapps
volumes:
iam_postgres_data:
finance_postgres_data:
redis_data:
rabbitmq_data:
minio_data:
networks:
goapps:
driver: bridge