Skip to content

Commit 047d2cb

Browse files
committed
fix: Correct frontend ports and prevent internet pulls in offline mode
This commit fixes critical deployment issues across production and offline configurations: ## Production (docker-compose.prod.yml) 1. **Frontend Port Fix**: - Change port mapping from 5173:80 to 5173:8080 - Update healthcheck to use port 8080 instead of 80 - Matches actual nginx configuration listening on port 8080 - **Fixes**: Frontend unhealthy, app not loading in browser 2. **Environment Variables**: - Add MODELS_DIRECTORY to backend and celery-worker - Ensures consistency with main docker-compose.yml ## Offline (docker-compose.offline.yml) 1. **Prevent Internet Access**: - Add `pull_policy: never` to ALL services (7 services total) - postgres, minio, redis, opensearch, backend, celery-worker, frontend, flower - **Critical**: Ensures no internet pulls in air-gapped environments - Images must be pre-loaded with `docker load` 2. **Frontend Port Fix**: - Change port mapping from 80:80 to 80:8080 - Add healthcheck with correct port 8080 - Matches nginx configuration 3. **Model Cache**: - Add model cache volume mounts to flower service - Ensures flower has access to pre-downloaded models ## Root Cause The frontend container's nginx listens on port 8080 (per nginx.conf), but both prod and offline compose files were mapping to port 80, causing healthchecks to fail and making the app unreachable. ## Testing - Production: Verified with one-line installer - Offline: Ensures no docker pull attempts in air-gapped systems - Both: Frontend now accessible and healthy This resolves the issue where setup completed but the app didn't load.
1 parent 8d0c3e4 commit 047d2cb

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

docker-compose.offline.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version: '3.8'
77
services:
88
postgres:
99
image: postgres:17.5-alpine
10+
pull_policy: never
1011
restart: always
1112
volumes:
1213
- postgres_data:/var/lib/postgresql/data/
@@ -25,6 +26,7 @@ services:
2526

2627
minio:
2728
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
29+
pull_policy: never
2830
restart: always
2931
volumes:
3032
- minio_data:/data
@@ -43,6 +45,7 @@ services:
4345

4446
redis:
4547
image: redis:8.2.2-alpine3.22
48+
pull_policy: never
4649
restart: always
4750
ports:
4851
- "${REDIS_PORT:-6379}:6379"
@@ -56,6 +59,7 @@ services:
5659

5760
opensearch:
5861
image: opensearchproject/opensearch:2.5.0
62+
pull_policy: never
5963
restart: always
6064
environment:
6165
- discovery.type=single-node
@@ -79,6 +83,7 @@ services:
7983

8084
backend:
8185
image: davidamacey/opentranscribe-backend:latest
86+
pull_policy: never
8287
restart: always
8388
volumes:
8489
- ${MODEL_CACHE_DIR:-/opt/opentranscribe/models}/huggingface:/root/.cache/huggingface
@@ -150,6 +155,7 @@ services:
150155

151156
celery-worker:
152157
image: davidamacey/opentranscribe-backend:latest
158+
pull_policy: never
153159
restart: always
154160
command: celery -A app.core.celery worker --loglevel=info -Q gpu,nlp,utility,celery --concurrency=1
155161
runtime: nvidia
@@ -215,17 +221,25 @@ services:
215221

216222
frontend:
217223
image: davidamacey/opentranscribe-frontend:latest
224+
pull_policy: never
218225
restart: always
219226
ports:
220-
- "${FRONTEND_PORT:-80}:80"
227+
- "${FRONTEND_PORT:-80}:8080"
221228
environment:
222229
- NODE_ENV=production
223230
depends_on:
224231
backend:
225232
condition: service_healthy
233+
healthcheck:
234+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080"]
235+
interval: 10s
236+
timeout: 5s
237+
retries: 5
238+
start_period: 30s
226239

227240
flower:
228241
image: davidamacey/opentranscribe-backend:latest
242+
pull_policy: never
229243
restart: always
230244
command: >
231245
python -m celery -A app.core.celery flower
@@ -243,6 +257,8 @@ services:
243257
- CELERY_BROKER_URL=redis://redis:6379/0
244258
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN:-}
245259
volumes:
260+
- ${MODEL_CACHE_DIR:-/opt/opentranscribe/models}/huggingface:/root/.cache/huggingface
261+
- ${MODEL_CACHE_DIR:-/opt/opentranscribe/models}/torch:/root/.cache/torch
246262
- flower_data:/app
247263

248264
volumes:

docker-compose.prod.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ services:
110110
- JWT_ALGORITHM=${JWT_ALGORITHM:-HS256}
111111
- JWT_ACCESS_TOKEN_EXPIRE_MINUTES=${JWT_ACCESS_TOKEN_EXPIRE_MINUTES:-60}
112112
# Models
113+
- MODELS_DIRECTORY=${MODELS_DIRECTORY:-/app/models}
113114
- MODEL_BASE_DIR=${MODEL_BASE_DIR:-/app/models}
114115
- TEMP_DIR=${TEMP_DIR:-/app/temp}
115116
# Hardware (auto-detected)
@@ -181,6 +182,7 @@ services:
181182
- REDIS_PORT=6379
182183
- OPENSEARCH_HOST=${OPENSEARCH_HOST:-opensearch}
183184
- OPENSEARCH_PORT=9200
185+
- MODELS_DIRECTORY=${MODELS_DIRECTORY:-/app/models}
184186
- MODEL_BASE_DIR=${MODEL_BASE_DIR:-/app/models}
185187
- TEMP_DIR=${TEMP_DIR:-/app/temp}
186188
- TORCH_DEVICE=${TORCH_DEVICE:-auto}
@@ -220,7 +222,7 @@ services:
220222
pull_policy: always
221223
restart: always
222224
ports:
223-
- "${FRONTEND_PORT:-5173}:80"
225+
- "${FRONTEND_PORT:-5173}:8080"
224226
environment:
225227
- NODE_ENV=production
226228
- VITE_API_BASE_URL=http://localhost:${BACKEND_PORT:-5174}/api
@@ -231,7 +233,7 @@ services:
231233
backend:
232234
condition: service_healthy
233235
healthcheck:
234-
test: ["CMD", "wget", "--spider", "-q", "http://localhost:80"]
236+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080"]
235237
interval: 10s
236238
timeout: 5s
237239
retries: 5

0 commit comments

Comments
 (0)