-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-compose.e2e.yml
More file actions
247 lines (238 loc) · 7.13 KB
/
docker-compose.e2e.yml
File metadata and controls
247 lines (238 loc) · 7.13 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
networks:
e2e-network:
name: e2e-network # Fixed name (no project prefix)
driver: bridge
services:
postgres:
image: postgres:18
container_name: e2e-postgres
environment:
POSTGRES_DB: axumkit
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespw
ports:
- "5432" # Dynamic port allocation
networks:
- e2e-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d axumkit"]
interval: 5s
timeout: 3s
retries: 10
redis-session:
image: redis:8-alpine
container_name: e2e-redis-session
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy volatile-ttl
networks:
- e2e-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
redis-cache:
image: redis:8-alpine
container_name: e2e-redis-cache
command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru
networks:
- e2e-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
meilisearch:
image: getmeili/meilisearch:v1.30.1
container_name: e2e-meilisearch
environment:
MEILI_ENV: development
MEILI_NO_ANALYTICS: "true"
networks:
- e2e-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7700/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
nats:
image: nats:2.12.3-alpine
container_name: e2e-nats
command: ["--jetstream", "--store_dir=/data", "-m", "8222"]
networks:
- e2e-network
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"]
interval: 5s
timeout: 3s
retries: 10
object-storage:
image: minio/minio:latest
container_name: e2e-object-storage
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
networks:
- e2e-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 3s
retries: 15
start_period: 10s
object-storage-init:
image: minio/mc:latest
container_name: e2e-object-storage-init
entrypoint: /bin/sh
command:
- -c
- >
mc alias set local http://object-storage:9000 minioadmin minioadmin &&
mc mb --ignore-existing local/axumkit-assets-test &&
mc anonymous set download local/axumkit-assets-test
networks:
- e2e-network
depends_on:
object-storage:
condition: service_healthy
server:
image: e2e-server:latest
build:
context: .
target: server-runtime
container_name: e2e-server
ports:
- "8000" # Dynamic port allocation
environment:
ENVIRONMENT: test
HOST: 0.0.0.0
PORT: "8000"
RUST_LOG: info
POSTGRES_WRITE_HOST: postgres
POSTGRES_WRITE_PORT: "5432"
POSTGRES_WRITE_NAME: axumkit
POSTGRES_WRITE_USER: postgres
POSTGRES_WRITE_PASSWORD: postgrespw
POSTGRES_WRITE_MAX_CONNECTION: "10"
POSTGRES_WRITE_MIN_CONNECTION: "2"
POSTGRES_READ_HOST: postgres
POSTGRES_READ_PORT: "5432"
POSTGRES_READ_NAME: axumkit
POSTGRES_READ_USER: postgres
POSTGRES_READ_PASSWORD: postgrespw
POSTGRES_READ_MAX_CONNECTION: "10"
POSTGRES_READ_MIN_CONNECTION: "2"
REDIS_SESSION_HOST: redis-session
REDIS_SESSION_PORT: "6379"
REDIS_CACHE_HOST: redis-cache
REDIS_CACHE_PORT: "6379"
REDIS_CACHE_TTL: "3600"
MEILISEARCH_HOST: http://meilisearch:7700
NATS_URL: nats://nats:4222
R2_ENDPOINT: http://object-storage:9000
R2_ACCESS_KEY_ID: minioadmin
R2_SECRET_ACCESS_KEY: minioadmin
R2_ASSETS_BUCKET_NAME: axumkit-assets-test
R2_REGION: us-east-1
R2_ASSETS_PUBLIC_DOMAIN: http://localhost:9000/axumkit-assets-test
TOTP_SECRET: test-totp-secret-key-for-e2e
AUTH_SESSION_MAX_LIFETIME_HOURS: "720"
AUTH_SESSION_SLIDING_TTL_HOURS: "168"
AUTH_SESSION_REFRESH_THRESHOLD: "50"
TURNSTILE_SECRET_KEY: 1x0000000000000000000000000000000AA
GOOGLE_CLIENT_ID: mock
GOOGLE_CLIENT_SECRET: mock
GOOGLE_REDIRECT_URI: http://localhost:8000/auth/google/callback
GOOGLE_LINK_REDIRECT_URI: http://localhost:8000/auth/google/link
GITHUB_CLIENT_ID: mock
GITHUB_CLIENT_SECRET: mock
GITHUB_REDIRECT_URI: http://localhost:8000/auth/github/callback
CORS_ALLOWED_ORIGINS: http://localhost:5173
CORS_ALLOWED_HEADERS: Content-Type,Authorization
CORS_MAX_AGE: "86400"
networks:
- e2e-network
depends_on:
postgres:
condition: service_healthy
redis-session:
condition: service_healthy
redis-cache:
condition: service_healthy
meilisearch:
condition: service_healthy
nats:
condition: service_healthy
object-storage-init:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health-check"]
interval: 5s
timeout: 3s
retries: 15
start_period: 30s
worker:
image: e2e-worker:latest
build:
context: .
target: worker-runtime
container_name: e2e-worker
environment:
RUST_LOG: info
# Database (Write only)
POSTGRES_WRITE_HOST: postgres
POSTGRES_WRITE_PORT: "5432"
POSTGRES_WRITE_NAME: axumkit
POSTGRES_WRITE_USER: postgres
POSTGRES_WRITE_PASSWORD: postgrespw
POSTGRES_WRITE_MAX_CONNECTION: "10"
POSTGRES_WRITE_MIN_CONNECTION: "2"
# Job Queue
NATS_URL: nats://nats:4222
# Search
MEILISEARCH_HOST: http://meilisearch:7700
# Redis Cache
REDIS_CACHE_HOST: redis-cache
REDIS_CACHE_PORT: "6379"
# Redis Session (persistent store for cron locks)
REDIS_SESSION_HOST: redis-session
REDIS_SESSION_PORT: "6379"
# SMTP (mock for e2e)
SMTP_HOST: localhost
SMTP_PORT: "25"
SMTP_USER: test
SMTP_PASSWORD: test
SMTP_TLS: "false"
EMAILS_FROM_EMAIL: test@test.com
EMAILS_FROM_NAME: Test
# Frontend
FRONTEND_HOST: http://localhost:5173
PROJECT_NAME: axumkit
FRONTEND_PATH_VERIFY_EMAIL: /verify-email
FRONTEND_PATH_RESET_PASSWORD: /reset-password
FRONTEND_PATH_CONFIRM_EMAIL_CHANGE: /confirm-email-change
# R2-compatible object storage (MinIO)
R2_ENDPOINT: http://object-storage:9000
R2_REGION: us-east-1
R2_ACCESS_KEY_ID: minioadmin
R2_SECRET_ACCESS_KEY: minioadmin
R2_ASSETS_BUCKET_NAME: axumkit-assets-test
R2_ASSETS_PUBLIC_DOMAIN: http://localhost:9000/axumkit-assets-test
networks:
- e2e-network
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_healthy
meilisearch:
condition: service_healthy
redis-cache:
condition: service_healthy
redis-session:
condition: service_healthy
object-storage-init:
condition: service_completed_successfully