-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
184 lines (171 loc) · 5.05 KB
/
docker-compose.yaml
File metadata and controls
184 lines (171 loc) · 5.05 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
services:
# ── Infrastructure ────────────────────────────────────────────────────────────
postgres:
image: postgres:16
container_name: chess-postgres
restart: unless-stopped
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chess
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: chess-redis
restart: unless-stopped
ports:
- "6379:6379"
command: redis-server --save "" --appendonly no
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# ── One-shot migration (run once, then exit) ──────────────────────────────────
migrate:
build:
context: .
dockerfile: packages/db/Dockerfile
container_name: chess-migrate
depends_on:
postgres:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/chess
# ── Application services ──────────────────────────────────────────────────────
backend:
build:
context: .
dockerfile: apps/backend/Dockerfile
container_name: chess-backend
image: chess-backend
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
ports:
- "3001:3001"
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/chess
- REDIS_URL=redis://redis:6379
- FRONTEND_ORIGIN=http://localhost:3000
- ADMIN_ORIGIN=http://localhost:3003
- JWT_SECRET=local-jwt-secret
- MCP_SECRET=local-mcp-secret
- PORT=3001
ws:
build:
context: .
dockerfile: apps/ws/Dockerfile
container_name: chess-ws
image: chess-ws
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
ports:
- "4000:4000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/chess
- REDIS_URL=redis://redis:6379
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_URL_INTERNAL=http://web:3000
- NEXTAUTH_SECRET=local-nextauth-secret
- PORT=4000
worker:
build:
context: .
dockerfile: apps/worker/Dockerfile
container_name: chess-worker
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/chess
- REDIS_MOVES=redis://redis:6379
agent:
build:
context: .
dockerfile: apps/agent/Dockerfile
container_name: chess-agent
image: chess-agent
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
backend:
condition: service_started
ports:
- "3002:3002"
environment:
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- OPENROUTER_MODEL=${OPENROUTER_MODEL:-google/gemma-4-26b-a4b-it:free}
- BACKEND_URL=http://backend:3001
- CHESS_WS_URL=ws://ws:4000
- MCP_SECRET=local-mcp-secret
- FRONTEND_ORIGIN=http://localhost:3000
- REDIS_URL=redis://redis:6379
- EXA_API_KEY=${EXA_API_KEY:-}
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/chess
- PORT=3002
admin:
build:
context: .
dockerfile: apps/admin/Dockerfile
container_name: chess-admin
image: chess-admin
restart: unless-stopped
depends_on:
backend:
condition: service_started
ports:
- "3003:3003"
environment:
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
- JWT_SECRET=local-admin-jwt-secret
- NEXT_PUBLIC_BACKEND_URL=http://localhost:3001
- PORT=3003
web:
build:
context: .
dockerfile: apps/web/Dockerfile
container_name: chess-web
image: chess-frontend
restart: unless-stopped
depends_on:
backend:
condition: service_started
ws:
condition: service_started
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/chess
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_URL_INTERNAL=http://web:3000
- NEXTAUTH_SECRET=local-nextauth-secret
- BACKEND_URL=http://backend:3001
volumes:
postgres_data: