Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (75 loc) · 2.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
79 lines (75 loc) · 2.54 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
services:
postgres:
image: postgis/postgis:16-3.4
environment:
POSTGRES_USER: devbench
POSTGRES_PASSWORD: devbench
POSTGRES_DB: devbench_spatial
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./spatial/migrations:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U devbench -d devbench_spatial"]
interval: 5s
timeout: 5s
retries: 10
dynamodb-local:
# NOTE: do not bump to 2.x. DynamoDB Local 2.5.2 (Jetty 12.0.8) hangs on any
# SigV4-signed Authorization header, so every boto3/aioboto3 call times out with
# ReadTimeoutError while unsigned curl works. 1.21.0 handles signed requests.
image: amazon/dynamodb-local:1.21.0
# 1.21.0 runs as uid 1000 (dynamodblocal), but the named volume mounts /data as
# root:root, so the process can't create the SQLite file (SQLITE error 14). Run as
# root so -dbPath persistence works.
user: root
command: ["-jar", "DynamoDBLocal.jar", "-sharedDb", "-dbPath", "/data"]
ports:
- "8000:8000"
volumes:
- dynamodb_data:/data
healthcheck:
# Unsigned request returns 400 MissingAuthenticationToken — that still proves the
# API is alive. Don't use `curl -f` (it treats 400 as failure); just confirm a
# response comes back.
test: ["CMD-SHELL", "curl -s -o /dev/null http://localhost:8000 || exit 1"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
devbench:
# Main application container: FastAPI results dashboard + extraction runner.
build: .
depends_on:
postgres:
condition: service_healthy
dynamodb-local:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
environment:
# Override host-based vars from .env with in-network service names.
POSTGRES_HOST: postgres
DYNAMODB_ENDPOINT_URL: http://dynamodb-local:8000
REDIS_URL: redis://redis:6379
# Create the results table on first boot so the dashboard doesn't 500 cold.
DEVBENCH_ENSURE_TABLE: "1"
ports:
- "8080:8080"
# Serve the dashboard by default; run benchmarks with:
# docker compose run --rm devbench python scripts/run_baseline.py
command: ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8080"]
volumes:
postgres_data:
dynamodb_data: