-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (102 loc) · 3.89 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (102 loc) · 3.89 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
# ---------------------------------------------------------------------------
# NOTE for public-repo viewers: the ``gw2analytics`` / ``gw2analytics`` /
# ``gw2analytics-secret`` credentials below are DEV-ONLY PLACEHOLDERS --
# they ship with the repo so ``docker compose up -d`` works out of the box
# for a fresh checkout. None of these values are used in production. The
# real Postgres / MinIO credentials live in a secrets manager (see
# apps/api/.env.example for the variable names; production overrides
# those via env, NEVER by editing this file).
# ---------------------------------------------------------------------------
services:
postgres:
image: postgres:16-alpine
container_name: gw2a-postgres
environment:
POSTGRES_USER: gw2analytics
POSTGRES_PASSWORD: gw2analytics
POSTGRES_DB: gw2analytics
# v0.10.6: standardized to `5432:5432` so the dev host port
# matches `pyproject.toml`'s `[tool.pytest_env] DATABASE_URL`
# AND `.github/workflows/ci.yml`'s postgres service. If the dev
# host already has another postgres on port 5432 (e.g. `wvw-postgres`
# from a sibling workspace), the operator must free the port
# with `docker rm -f wvw-postgres` BEFORE bringing this one up.
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U gw2analytics"]
interval: 5s
timeout: 5s
retries: 5
minio:
# Built from docker/minio/Dockerfile: the upstream minio/minio image is no
# longer pullable (Docker Hub repo deleted, quay.io denies anonymous pull),
# so this pins the official GitHub Release binary and verifies its SHA-256
# at build time. See docker/minio/Dockerfile for the upgrade procedure.
image: gw2a-minio:RELEASE.2025-09-07T16-13-09Z
build:
context: .
dockerfile: docker/minio/Dockerfile
container_name: gw2a-minio
command: server /data --console-address ":9001"
environment:
# DEV-ONLY PLACEHOLDER -- see top-of-file note above.
MINIO_ROOT_USER: gw2analytics
MINIO_ROOT_PASSWORD: gw2analytics-secret
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 5
# v0.10.1 plan 010: Redis broker for the Arq parser worker.
# The ``parser_worker.py`` + ``routes/uploads.py`` migration moves
# the CPU-bound ``process_parse`` off FastAPI's ``BackgroundTasks``
# thread pool (which is bottlenecked by the GIL on parallel
# uploads) to a dedicated Arq worker process. Redis is the
# Arq broker; the worker is a separate process started via
# ``arq gw2analytics_api.workers.parser_settings.WorkerSettings``.
redis:
image: redis:7-alpine
container_name: gw2a-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
# v0.15.0: Arq parser worker — offloads CPU-bound .zevtc parsing
# from the API's in-request thread pool to a dedicated process
# with its own GIL. Uses the same API image but runs ``arq``
# instead of the FastAPI server.
arq-worker:
build:
context: .
dockerfile: apps/api/Dockerfile
container_name: gw2a-arq-worker
command: arq gw2analytics_api.workers.parser_settings.WorkerSettings
environment:
ARQ_REDIS_HOST: redis
DATABASE_URL: postgresql://gw2analytics:gw2analytics@postgres:5432/gw2analytics
S3_ENDPOINT: http://minio:9000
S3_ACCESS_KEY: gw2analytics
S3_SECRET_KEY: gw2analytics-secret
S3_BUCKET: gw2analytics
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
volumes:
pgdata:
miniodata: