-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
278 lines (266 loc) · 9.91 KB
/
docker-compose.yml
File metadata and controls
278 lines (266 loc) · 9.91 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
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
# ============================================================================
# POSTGRES PORT CONFLICT NOTE
# ============================================================================
# The default PostgreSQL port is 5432. On developer machines, this port is
# often already occupied by a local PostgreSQL installation (e.g., Postgres.app
# on macOS, or a system PostgreSQL on Linux).
#
# If port 5432 is in use, set PLANEXE_POSTGRES_PORT to a different value:
# export PLANEXE_POSTGRES_PORT=5433
# docker compose up
#
# This only affects the HOST port mapping (how you access Postgres from your
# machine). Inside Docker, containers always connect to each other on port 5432.
# ============================================================================
x-worker_plan_database-base: &worker_plan_database_base
build:
context: .
dockerfile: worker_plan_database/Dockerfile
depends_on:
database_postgres:
condition: service_healthy
env_file:
- .env
environment: &worker_plan_database_env
PLANEXE_WORKER_ID: ${PLANEXE_WORKER_ID:-worker_plan_database}
PLANEXE_CONFIG_PATH: /app
PLANEXE_RUN_DIR: /app/run
# Internal container-to-container connection always uses port 5432.
# This is NOT affected by PLANEXE_POSTGRES_PORT (which is for host mapping only).
PLANEXE_POSTGRES_HOST: database_postgres
PLANEXE_POSTGRES_PORT: "5432"
PLANEXE_POSTGRES_DB: ${PLANEXE_POSTGRES_DB:-planexe}
PLANEXE_POSTGRES_USER: ${PLANEXE_POSTGRES_USER:-planexe}
PLANEXE_POSTGRES_PASSWORD: ${PLANEXE_POSTGRES_PASSWORD:-planexe}
PLANEXE_IFRAME_GENERATOR_CONFIRMATION_PRODUCTION_URL: ${PLANEXE_IFRAME_GENERATOR_CONFIRMATION_PRODUCTION_URL:-https://example.com/iframe_generator_confirmation}
PLANEXE_IFRAME_GENERATOR_CONFIRMATION_DEVELOPMENT_URL: ${PLANEXE_IFRAME_GENERATOR_CONFIRMATION_DEVELOPMENT_URL:-https://example.com/iframe_generator_confirmation}
volumes:
- ./.env:/app/.env:ro
- ./llm_config:/app/llm_config:ro
- ./run:/app/run
restart: unless-stopped
services:
database_postgres:
build:
context: .
dockerfile: database_postgres/Dockerfile
container_name: database_postgres
environment:
PLANEXE_POSTGRES_USER: ${PLANEXE_POSTGRES_USER:-planexe}
PLANEXE_POSTGRES_PASSWORD: ${PLANEXE_POSTGRES_PASSWORD:-planexe}
PLANEXE_POSTGRES_DB: ${PLANEXE_POSTGRES_DB:-planexe}
POSTGRES_USER: ${PLANEXE_POSTGRES_USER:-planexe}
POSTGRES_PASSWORD: ${PLANEXE_POSTGRES_PASSWORD:-planexe}
POSTGRES_DB: ${PLANEXE_POSTGRES_DB:-planexe}
ports:
# PLANEXE_POSTGRES_PORT sets the HOST port (left side). The container always
# listens on 5432 internally (right side). If your machine already has a
# Postgres running on 5432 (e.g., Postgres.app on macOS), set a different
# host port: export PLANEXE_POSTGRES_PORT=5433
- "${PLANEXE_POSTGRES_PORT:-5432}:5432"
volumes:
- database_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PLANEXE_POSTGRES_USER:-planexe}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
restart: unless-stopped
worker_plan:
build:
context: .
dockerfile: worker_plan/Dockerfile
container_name: worker_plan
env_file:
- .env
environment:
PLANEXE_CONFIG_PATH: /app
PLANEXE_HOST_RUN_DIR: ${PLANEXE_HOST_RUN_DIR:-${PWD}/run}
PLANEXE_RUN_DIR: /app/run
PLANEXE_WORKER_RELAY_PROCESS_OUTPUT: "true"
ports:
- "8000:8000"
volumes:
- ./.env:/app/.env:ro
- ./llm_config:/app/llm_config:ro
- ./run:/app/run
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/healthcheck').read()"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
restart: unless-stopped
develop:
watch:
- action: sync
path: ./worker_plan
target: /app/worker_plan
- action: rebuild
path: ./worker_plan/pyproject.toml
- action: restart
path: ./docker-compose.yml
worker_plan_database:
<<: *worker_plan_database_base
container_name: worker_plan_database
profiles:
- manual
worker_plan_database_1:
<<: *worker_plan_database_base
container_name: worker_plan_database_1
environment:
<<: *worker_plan_database_env
PLANEXE_WORKER_ID: "1"
worker_plan_database_2:
<<: *worker_plan_database_base
container_name: worker_plan_database_2
environment:
<<: *worker_plan_database_env
PLANEXE_WORKER_ID: "2"
worker_plan_database_3:
<<: *worker_plan_database_base
container_name: worker_plan_database_3
environment:
<<: *worker_plan_database_env
PLANEXE_WORKER_ID: "3"
frontend_single_user:
build:
context: .
dockerfile: frontend_single_user/Dockerfile
container_name: frontend_single_user
depends_on:
worker_plan:
condition: service_healthy
env_file:
- .env
environment:
PLANEXE_WORKER_PLAN_URL: ${PLANEXE_WORKER_PLAN_URL:-http://worker_plan:8000}
PLANEXE_WORKER_PLAN_TIMEOUT: ${PLANEXE_WORKER_PLAN_TIMEOUT:-30}
PLANEXE_GRADIO_SERVER_NAME: ${PLANEXE_GRADIO_SERVER_NAME:-0.0.0.0}
PLANEXE_GRADIO_SERVER_PORT: ${PLANEXE_GRADIO_SERVER_PORT:-7860}
PLANEXE_PASSWORD: ${PLANEXE_PASSWORD:-}
PLANEXE_OPEN_DIR_SERVER_URL: ${PLANEXE_OPEN_DIR_SERVER_URL:-}
ports:
- "7860:7860"
volumes:
- ./.env:/app/.env:ro
- ./llm_config:/app/llm_config:ro
- ./run:/app/run
restart: unless-stopped
develop:
watch:
- action: sync
path: ./frontend_single_user
target: /app/frontend_single_user
- action: restart
path: ./frontend_single_user
- action: sync
path: ./worker_plan
target: /app/worker_plan
- action: sync
path: ./llm_config
target: /app/llm_config
- action: sync
path: ./.env
target: /app/.env
- action: rebuild
path: ./worker_plan/pyproject.toml
- action: restart
path: ./docker-compose.yml
frontend_multi_user:
build:
context: .
dockerfile: frontend_multi_user/Dockerfile
container_name: frontend_multi_user
depends_on:
database_postgres:
condition: service_healthy
worker_plan:
condition: service_healthy
env_file:
- .env
environment:
PLANEXE_FRONTEND_MULTIUSER_DB_HOST: ${PLANEXE_FRONTEND_MULTIUSER_DB_HOST:-database_postgres}
PLANEXE_FRONTEND_MULTIUSER_DB_PORT: ${PLANEXE_FRONTEND_MULTIUSER_DB_PORT:-5432}
PLANEXE_FRONTEND_MULTIUSER_DB_NAME: ${PLANEXE_POSTGRES_DB:-planexe}
PLANEXE_FRONTEND_MULTIUSER_DB_USER: ${PLANEXE_POSTGRES_USER:-planexe}
PLANEXE_FRONTEND_MULTIUSER_DB_PASSWORD: ${PLANEXE_POSTGRES_PASSWORD:-planexe}
PLANEXE_FRONTEND_MULTIUSER_ADMIN_USERNAME: ${PLANEXE_FRONTEND_MULTIUSER_ADMIN_USERNAME:-admin}
PLANEXE_FRONTEND_MULTIUSER_ADMIN_PASSWORD: ${PLANEXE_FRONTEND_MULTIUSER_ADMIN_PASSWORD:-admin}
PLANEXE_DATABASE_WORKER_URL: ${PLANEXE_DATABASE_WORKER_URL:-http://database_worker:8002}
PLANEXE_DATABASE_WORKER_API_KEY: ${PLANEXE_DATABASE_WORKER_API_KEY:-}
ports:
- "${PLANEXE_FRONTEND_MULTIUSER_PORT:-5001}:5000"
volumes:
- ./.env:/app/.env:ro
- ./llm_config:/app/llm_config:ro
- ./run:/app/run
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/healthcheck').read()"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# Use on-failure so config errors (exit 0) stop the container immediately
# instead of restart-looping. Runtime crashes (exit != 0) still restart.
restart: on-failure
database_worker:
build:
context: .
dockerfile: database_worker/Dockerfile
container_name: database_worker
depends_on:
database_postgres:
condition: service_healthy
environment:
PLANEXE_POSTGRES_HOST: database_postgres
PLANEXE_POSTGRES_PORT: "5432"
PLANEXE_POSTGRES_DB: ${PLANEXE_POSTGRES_DB:-planexe}
PLANEXE_POSTGRES_USER: ${PLANEXE_POSTGRES_USER:-planexe}
PLANEXE_POSTGRES_PASSWORD: ${PLANEXE_POSTGRES_PASSWORD:-planexe}
PLANEXE_DATABASE_WORKER_API_KEY: ${PLANEXE_DATABASE_WORKER_API_KEY:-}
restart: unless-stopped
mcp_cloud:
build:
context: .
dockerfile: mcp_cloud/Dockerfile
container_name: mcp_cloud
depends_on:
database_postgres:
condition: service_healthy
worker_plan:
condition: service_healthy
env_file:
- .env
environment:
PLANEXE_CONFIG_PATH: /app
PLANEXE_RUN_DIR: /app/run
# Internal container-to-container connection always uses port 5432.
PLANEXE_POSTGRES_HOST: database_postgres
PLANEXE_POSTGRES_PORT: "5432"
PLANEXE_POSTGRES_DB: ${PLANEXE_POSTGRES_DB:-planexe}
PLANEXE_POSTGRES_USER: ${PLANEXE_POSTGRES_USER:-planexe}
PLANEXE_POSTGRES_PASSWORD: ${PLANEXE_POSTGRES_PASSWORD:-planexe}
PLANEXE_MCP_HTTP_HOST: "0.0.0.0"
PLANEXE_MCP_HTTP_PORT: "8001"
PLANEXE_MCP_API_KEY: ${PLANEXE_MCP_API_KEY:-}
PLANEXE_MCP_REQUIRE_AUTH: ${PLANEXE_MCP_REQUIRE_AUTH:-false}
PLANEXE_MCP_PUBLIC_BASE_URL: ${PLANEXE_MCP_PUBLIC_BASE_URL:-http://localhost:8001}
PLANEXE_WORKER_PLAN_URL: ${PLANEXE_WORKER_PLAN_URL:-http://worker_plan:8000}
ports:
- "${PLANEXE_MCP_HTTP_PORT:-8001}:8001"
volumes:
- ./llm_config:/app/llm_config:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/healthcheck').read()"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
volumes:
database_postgres_data:
# Use the volume from the main PlanExe repo so both repos share the same database.
external: true
name: planexe_database_postgres_data