-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
325 lines (309 loc) · 9.09 KB
/
docker-compose.yml
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
services:
# base services - redis, postgres
redis:
image: redis/redis-stack:latest
container_name: redis
restart: always
ports:
- "6379:6379"
- "8001:8001"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: "5s"
volumes:
- ./docker/redis/data:/data
profiles:
- pubsub
postgres:
image: postgres:15
container_name: postgres
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
PGUSER: postgres
POSTGRES_PASSWORD: postgres
ADDITIONAL_DATABASES: kratos
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./docker/postgres/data:/var/lib/postgresql/data
- ./docker/postgres/scripts:/docker-entrypoint-initdb.d
profiles:
- database
caddy:
image: caddy:latest
container_name: caddy
ports:
- "80:80"
- "443:443"
volumes:
- ./docker/caddy/config/Caddyfile:/etc/caddy/Caddyfile
- ./docker/caddy/data:/data/caddy
profiles:
- caddy
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
# quadratic services - client, api, multiplayer, files, connection
quadratic-client:
image: ${ECR_URL}/quadratic-client:${IMAGE_TAG}
container_name: client
environment:
VITE_DEBUG: 1
VITE_QUADRATIC_API_URL: ${QUADRATIC_API_URL_EXTERNAL}
VITE_QUADRATIC_MULTIPLAYER_URL: ${QUADRATIC_MULTIPLAYER_URL_EXTERNAL}
VITE_QUADRATIC_CONNECTION_URL: ${QUADRATIC_CONNECTION_URL_EXTERNAL}
VITE_AUTH_TYPE: ${AUTH_TYPE}
VITE_STORAGE_TYPE: ${STORAGE_TYPE}
VITE_ORY_HOST: ${KRATOS_URL_EXTERNAL}
ports:
- "3000:80"
command: >
sh -c "/client/scripts/replace_env_vars.sh &&
nginx -g \"daemon off;\""
healthcheck:
test: ["CMD-SHELL", "curl -f http://host.docker.internal:3000/ || exit 1"]
interval: 10s
timeout: 5s
restart: "always"
volumes:
- ./docker/client:/client
- ./docker/client/config/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
quadratic-api:
condition: service_started
profiles:
- quadratic_client
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
quadratic-api:
image: ${ECR_URL}/quadratic-api:${IMAGE_TAG}
container_name: api
environment:
CORS: "*"
DATABASE_URL: ${DATABASE_DSN}
ENVIRONMENT: ${ENVIRONMENT}
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
OPENAI_API_KEY: ${OPENAI_API_KEY}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
EXA_API_KEY: ${EXA_API_KEY}
AWS_S3_REGION: ${AWS_S3_REGION}
AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME}
AWS_S3_ACCESS_KEY_ID: ${AWS_S3_ACCESS_KEY_ID}
AWS_S3_SECRET_ACCESS_KEY: ${AWS_S3_SECRET_ACCESS_KEY}
M2M_AUTH_TOKEN: ${M2M_AUTH_TOKEN}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
AUTH_TYPE: ${AUTH_TYPE}
ORY_JWKS_URI: ${JWKS_URI}
ORY_ADMIN_HOST: ${ORY_ADMIN_HOST}
STORAGE_TYPE: ${STORAGE_TYPE}
QUADRATIC_FILE_URI: ${QUADRATIC_FILES_URL_INTERNAL}
QUADRATIC_FILE_URI_PUBLIC: ${QUADRATIC_FILES_URL_EXTERNAL}
LICENSE_KEY: ${LICENSE_KEY}
restart: "always"
ports:
- "8000:8000"
command: bash -c "npx prisma migrate deploy --schema quadratic-api/prisma/schema.prisma && npm run start:prod --workspace=quadratic-api"
depends_on:
postgres:
condition: service_healthy
profiles:
- quadratic_api
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
quadratic-multiplayer:
image: ${ECR_URL}/quadratic-multiplayer:${IMAGE_TAG}
container_name: multiplayer
environment:
RUST_LOG: ${QUADRATIC_MULTIPLAYER_RUST_LOG}
HOST: ${QUADRATIC_MULTIPLAYER_HOST}
PORT: ${QUADRATIC_MULTIPLAYER_PORT}
HEARTBEAT_CHECK_S: ${QUADRATIC_MULTIPLAYER_HEARTBEAT_CHECK_S}
HEARTBEAT_TIMEOUT_S: ${QUADRATIC_MULTIPLAYER_HEARTBEAT_TIMEOUT_S}
QUADRATIC_API_URI: ${QUADRATIC_API_URL_INTERNAL}
M2M_AUTH_TOKEN: ${M2M_AUTH_TOKEN}
ENVIRONMENT: ${ENVIRONMENT}
PUBSUB_HOST: ${PUBSUB_HOST}
PUBSUB_PORT: ${PUBSUB_PORT}
PUBSUB_PASSWORD: ${PUBSUB_PASSWORD}
PUBSUB_ACTIVE_CHANNELS: ${PUBSUB_ACTIVE_CHANNELS}
AUTH0_JWKS_URI: ${JWKS_URI}
AUTHENTICATE_JWT: true
restart: "always"
ports:
- "3001:3001"
depends_on:
redis:
condition: service_healthy
quadratic-client:
condition: service_healthy
quadratic-api:
condition: service_started
profiles:
- quadratic_multiplayer
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
quadratic-files:
image: ${ECR_URL}/quadratic-files:${IMAGE_TAG}
container_name: files
environment:
RUST_LOG: ${QUADRATIC_FILES_RUST_LOG}
HOST: ${QUADRATIC_FILES_HOST}
PORT: ${QUADRATIC_FILES_PORT}
FILE_CHECK_S: ${QUADRATIC_FILES_FILE_CHECK_S}
FILES_PER_CHECK: ${QUADRATIC_FILES_FILES_PER_CHECK}
TRUNCATE_FILE_CHECK_S: ${QUADRATIC_FILES_TRUNCATE_FILE_CHECK_S}
TRUNCATE_TRANSACTION_AGE_DAYS: ${QUADRATIC_FILES_TRUNCATE_TRANSACTION_AGE_DAYS}
ENVIRONMENT: ${ENVIRONMENT}
AUTH0_JWKS_URI: ${JWKS_URI}
QUADRATIC_API_URI: ${QUADRATIC_API_URL_INTERNAL}
M2M_AUTH_TOKEN: ${M2M_AUTH_TOKEN}
PUBSUB_HOST: ${PUBSUB_HOST}
PUBSUB_PORT: ${PUBSUB_PORT}
PUBSUB_PASSWORD: ${PUBSUB_PASSWORD}
PUBSUB_ACTIVE_CHANNELS: ${PUBSUB_ACTIVE_CHANNELS}
PUBSUB_PROCESSED_TRANSACTIONS_CHANNEL: ${PUBSUB_PROCESSED_TRANSACTIONS_CHANNEL}
STORAGE_TYPE: ${STORAGE_TYPE}
AWS_S3_REGION: ${AWS_S3_REGION}
AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME}
AWS_S3_ACCESS_KEY_ID: ${AWS_S3_ACCESS_KEY_ID}
AWS_S3_SECRET_ACCESS_KEY: ${AWS_S3_SECRET_ACCESS_KEY}
STORAGE_DIR: ${STORAGE_DIR}
STORAGE_ENCRYPTION_KEYS: ${ENCRYPTION_KEY}
restart: "always"
ports:
- "3002:3002"
volumes:
- ./docker/file-storage:/file-storage
depends_on:
redis:
condition: service_healthy
quadratic-client:
condition: service_healthy
quadratic-api:
condition: service_started
profiles:
- quadratic_files
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
quadratic-connection:
image: ${ECR_URL}/quadratic-connection:${IMAGE_TAG}
container_name: connection
environment:
RUST_LOG: ${QUADRATIC_CONNECTION_RUST_LOG}
HOST: ${QUADRATIC_CONNECTION_HOST}
PORT: ${QUADRATIC_CONNECTION_PORT}
ENVIRONMENT: ${ENVIRONMENT}
AUTH0_JWKS_URI: ${JWKS_URI}
QUADRATIC_API_URI: ${QUADRATIC_API_URL_INTERNAL}
M2M_AUTH_TOKEN: ${M2M_AUTH_TOKEN}
MAX_RESPONSE_BYTES: ${QUADRATIC_CONNECTION_MAX_RESPONSE_BYTES}
STATIC_IPS: ${QUADRATIC_CONNECTION_STATIC_IPS}
restart: "always"
ports:
- "3003:3003"
depends_on:
quadratic-client:
condition: service_healthy
quadratic-api:
condition: service_started
profiles:
- quadratic_connection
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
# auth service - ory
ory-auth:
image: oryd/kratos:v1.2.0
container_name: ory-auth
ports:
- "4433:4433" # public
- "4434:4434" # admin
command: serve -c /etc/config/kratos/kratos.yml --dev --watch-courier
volumes:
- ./docker/ory-auth/config:/etc/config/kratos
environment:
DSN: ${ORY_DSN}
LOG_LEVEL: ${ORY_LOG_LEVEL}
restart: unless-stopped
depends_on:
- postgres
- ory-auth-migrate
profiles:
- ory
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
ory-auth-migrate:
image: oryd/kratos:v1.2.0
container_name: ory-auth-migrate
command: migrate -c /etc/config/kratos/kratos.yml sql -e --yes
volumes:
- ./docker/ory-auth/config:/etc/config/kratos
environment:
DSN: ${ORY_DSN}
restart: on-failure
depends_on:
- postgres
profiles:
- ory
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
ory-auth-node:
image: oryd/kratos-selfservice-ui-node:v1.2.0
container_name: ory-auth-node
ports:
- "4455:4455"
environment:
PORT: ${KRATOS_NODE_PORT}
KRATOS_PUBLIC_URL: ${KRATOS_URL_INTERNAL}
KRATOS_BROWSER_URL: ${KRATOS_URL_EXTERNAL}
COOKIE_SECRET: ${KRATOS_COOKIE_SECRET}
CSRF_COOKIE_NAME: ${KRATOS_CSRF_COOKIE_NAME}
CSRF_COOKIE_SECRET: ${KRATOS_CSRF_COOKIE_SECRET}
restart: on-failure
depends_on:
- ory-auth
profiles:
- ory
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
ory-auth-mail:
image: oryd/mailslurper:latest-smtps
ports:
- "1025:1025"
- "4436:4436"
- "4437:4437"
- "8080:8080"
profiles:
- ory
networks:
- host
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
docker:
name: docker
networks:
host: