-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (102 loc) · 2.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
108 lines (102 loc) · 2.86 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
# Local development stack for XStreamRoll.
#
# Usage:
# docker compose up
#
# Brings up PostgreSQL, Redis, the API, the App frontend, and the
# Processing worker with working defaults — no manual .env setup required.
# The app becomes available at http://localhost:3000.
#
# Every credential/secret below is a placeholder suitable for LOCAL
# DEVELOPMENT ONLY. Never reuse these values outside your machine.
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: xstreamroll_dev
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
- ./database/audit_logs.sql:/docker-entrypoint-initdb.d/02-audit-logs.sql:ro
- ./database/apply-migrations.sh:/docker-entrypoint-initdb.d/03-apply-migrations.sh:ro
- ./database/migrations:/migrations:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d xstreamroll_dev"]
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
api:
build:
context: ./api
ports:
- "3001:3001"
environment:
PORT: 3001
NODE_ENV: development
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/xstreamroll_dev
REDIS_URL: redis://redis:6379
JWT_SECRET: dev-only-jwt-secret-do-not-use-in-production
STREAM_API_KEY: dev-only-stream-api-key-do-not-use-in-production
CORS_ORIGIN: http://localhost:3000
THROTTLE_TTL: 60000
THROTTLE_LIMIT: 100
DB_STATEMENT_TIMEOUT_MS: 5000
ALLOW_HEADER_ROLES: 1
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/health || exit 1"]
interval: 5s
timeout: 5s
retries: 10
app:
build:
context: ./app
args:
NEXT_PUBLIC_API_URL: http://localhost:3001
NEXT_PUBLIC_VIEWER_URL: http://localhost:3000
ports:
- "3000:3000"
environment:
PORT: 3000
NODE_ENV: production
API_URL: http://api:3001
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000 || exit 1"]
interval: 5s
timeout: 5s
retries: 10
processing:
build:
context: ./xstreamroll-processing
environment:
NODE_ENV: development
API_URL: http://api:3001
POLL_INTERVAL_MS: 5000
MAX_CONCURRENT_SESSIONS: 32
LOCK_BACKEND: memory
LOCK_TTL_MS: 30000
depends_on:
api:
condition: service_healthy
volumes:
postgres_data: