fix: correct healthchecks and env variable handling for custom ports

- Fix healthchecks to use internal ports (8080, 8081, 8082, 7700) instead of external ports
- Remove variable expansion from healthcheck URLs (not supported in compose)
- Update .env.example to clarify internal vs external ports
- Ensure DATABASE_URL always uses internal PostgreSQL port (5432)
- Services now correctly start with custom external port mappings
This commit is contained in:
2026-03-06 21:23:20 +01:00
parent d0a29196dd
commit 47e53a19b9
2 changed files with 13 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ API_BOOTSTRAP_TOKEN=change-me-in-production
# ============================================================================= # =============================================================================
# Port Configuration (change only if you have port conflicts) # Port Configuration (change only if you have port conflicts)
# Update both the PORT variable AND the URL variables below
# ============================================================================= # =============================================================================
# Main application ports # Main application ports
@@ -31,25 +32,27 @@ MEILI_PORT=7700
POSTGRES_PORT=5432 POSTGRES_PORT=5432
# ============================================================================= # =============================================================================
# Service URLs (auto-generated from ports above - don't change unless you know what you're doing) # Service URLs (update these when you change ports above!)
# ============================================================================= # =============================================================================
# API Service # API Service
API_LISTEN_ADDR=0.0.0.0:${API_PORT} API_LISTEN_ADDR=0.0.0.0:8080
API_BASE_URL=http://api:${API_PORT} API_BASE_URL=http://api:8080
# Indexer Service # Indexer Service
INDEXER_LISTEN_ADDR=0.0.0.0:${INDEXER_PORT} INDEXER_LISTEN_ADDR=0.0.0.0:8081
INDEXER_SCAN_INTERVAL_SECONDS=5 INDEXER_SCAN_INTERVAL_SECONDS=5
# Backoffice Web UI # Backoffice Web UI
# Uses BACKOFFICE_PORT from above # Uses BACKOFFICE_PORT from above
# Meilisearch Search Engine # Meilisearch Search Engine
MEILI_URL=http://meilisearch:${MEILI_PORT} MEILI_URL=http://meilisearch:7700
# PostgreSQL Database # PostgreSQL Database
DATABASE_URL=postgres://stripstream:stripstream@postgres:${POSTGRES_PORT}/stripstream # Note: Always use port 5432 here (internal Docker port)
# Change POSTGRES_PORT above only for the external mapping
DATABASE_URL=postgres://stripstream:stripstream@postgres:5432/stripstream
# ============================================================================= # =============================================================================
# Storage Configuration # Storage Configuration

View File

@@ -24,7 +24,7 @@ services:
volumes: volumes:
- meili_data:/meili_data - meili_data:/meili_data
healthcheck: healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:${MEILI_PORT:-7700}/health"] test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7700/health"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -65,7 +65,7 @@ services:
meilisearch: meilisearch:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:${API_PORT:-8080}/health"] test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/health"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -88,7 +88,7 @@ services:
meilisearch: meilisearch:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:${INDEXER_PORT:-8081}/health"] test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8081/health"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -108,7 +108,7 @@ services:
api: api:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://host.docker.internal:${BACKOFFICE_PORT:-8082}/health"] test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8082/health"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5