-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
230 lines (215 loc) · 5.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
230 lines (215 loc) · 5.19 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
# Acton-HTMX Microservices Stack
#
# Usage:
# docker compose up -d # Start all services
# docker compose up auth data # Start specific services
# docker compose logs -f auth # View logs
# docker compose down # Stop all services
#
# Build individual services:
# docker compose build auth
# docker compose build --no-cache auth
services:
# ==========================================================================
# Infrastructure
# ==========================================================================
db:
image: postgres:16-alpine
container_name: acton-db
environment:
POSTGRES_USER: acton
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-acton_dev}
POSTGRES_DB: acton
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U acton"]
interval: 5s
timeout: 5s
retries: 5
networks:
- acton-network
redis:
image: redis:7-alpine
container_name: acton-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- acton-network
# ==========================================================================
# Microservices
# ==========================================================================
auth:
build:
context: .
dockerfile: docker/Dockerfile.service
args:
SERVICE: auth-service
container_name: acton-auth
ports:
- "50051:50051"
environment:
SERVICE_PORT: 50051
RUST_LOG: info
healthcheck:
test: ["CMD", "test", "-f", "/tmp/healthy"]
interval: 30s
timeout: 5s
retries: 3
networks:
- acton-network
data:
build:
context: .
dockerfile: docker/Dockerfile.service
args:
SERVICE: data-service
container_name: acton-data
ports:
- "50052:50052"
environment:
SERVICE_PORT: 50052
DATABASE_URL: postgresql://acton:${POSTGRES_PASSWORD:-acton_dev}@db:5432/acton
RUST_LOG: info
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "test", "-f", "/tmp/healthy"]
interval: 30s
timeout: 5s
retries: 3
networks:
- acton-network
cedar:
build:
context: .
dockerfile: docker/Dockerfile.service
args:
SERVICE: cedar-service
container_name: acton-cedar
ports:
- "50053:50053"
environment:
SERVICE_PORT: 50053
RUST_LOG: info
volumes:
- ./policies:/etc/acton/policies:ro
healthcheck:
test: ["CMD", "test", "-f", "/tmp/healthy"]
interval: 30s
timeout: 5s
retries: 3
networks:
- acton-network
cache:
build:
context: .
dockerfile: docker/Dockerfile.service
args:
SERVICE: cache-service
container_name: acton-cache
ports:
- "50054:50054"
environment:
SERVICE_PORT: 50054
REDIS_URL: redis://redis:6379
RUST_LOG: info
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "test", "-f", "/tmp/healthy"]
interval: 30s
timeout: 5s
retries: 3
networks:
- acton-network
email:
build:
context: .
dockerfile: docker/Dockerfile.service
args:
SERVICE: email-service
container_name: acton-email
ports:
- "50055:50055"
environment:
SERVICE_PORT: 50055
SMTP_HOST: ${SMTP_HOST:-mailhog}
SMTP_PORT: ${SMTP_PORT:-1025}
SMTP_USERNAME: ${SMTP_USERNAME:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
RUST_LOG: info
healthcheck:
test: ["CMD", "test", "-f", "/tmp/healthy"]
interval: 30s
timeout: 5s
retries: 3
networks:
- acton-network
file:
build:
context: .
dockerfile: docker/Dockerfile.service
args:
SERVICE: file-service
container_name: acton-file
ports:
- "50056:50056"
environment:
SERVICE_PORT: 50056
STORAGE_PATH: /data/uploads
RUST_LOG: info
volumes:
- file_uploads:/data/uploads
healthcheck:
test: ["CMD", "test", "-f", "/tmp/healthy"]
interval: 30s
timeout: 5s
retries: 3
networks:
- acton-network
# ==========================================================================
# Development Tools (optional)
# ==========================================================================
mailhog:
image: mailhog/mailhog
container_name: acton-mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
profiles:
- dev
networks:
- acton-network
# Observability stack
jaeger:
image: jaegertracing/all-in-one:latest
container_name: acton-jaeger
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "16686:16686" # Web UI
environment:
COLLECTOR_OTLP_ENABLED: true
profiles:
- observability
networks:
- acton-network
networks:
acton-network:
driver: bridge
volumes:
postgres_data:
redis_data:
file_uploads: