refactor: hardcode ports in docker-compose.yml for server deployment

- Remove env variable substitution from docker-compose.yml ports
- Hardcode custom ports directly in compose file: 7080, 7081, 7082, 7700, 6432
- Remove PORT variables from .env.example (now configured in docker-compose.yml)
- Add documentation on how to change ports (edit docker-compose.yml directly)
- Simplifies server deployment - no need to export env variables before docker-compose up

Note: To change ports, edit infra/docker-compose.yml directly
This commit is contained in:
2026-03-06 21:24:45 +01:00
parent 47e53a19b9
commit d86301919d
2 changed files with 17 additions and 27 deletions

View File

@@ -3,8 +3,7 @@
# HOW TO USE: # HOW TO USE:
# 1. Copy this file to .env: cp .env.example .env # 1. Copy this file to .env: cp .env.example .env
# 2. Change the REQUIRED values below # 2. Change the REQUIRED values below
# 3. Optionally change ports if you have conflicts # 3. Run: docker-compose up --build
# 4. Run: docker-compose up --build
# ============================================================================= # =============================================================================
# REQUIRED - Change these values in production! # REQUIRED - Change these values in production!
@@ -18,21 +17,7 @@ MEILI_MASTER_KEY=change-me-in-production
API_BOOTSTRAP_TOKEN=change-me-in-production API_BOOTSTRAP_TOKEN=change-me-in-production
# ============================================================================= # =============================================================================
# Port Configuration (change only if you have port conflicts) # Service Configuration
# Update both the PORT variable AND the URL variables below
# =============================================================================
# Main application ports
API_PORT=8080
INDEXER_PORT=8081
BACKOFFICE_PORT=8082
# Infrastructure ports
MEILI_PORT=7700
POSTGRES_PORT=5432
# =============================================================================
# Service URLs (update these when you change ports above!)
# ============================================================================= # =============================================================================
# API Service # API Service
@@ -43,15 +28,10 @@ API_BASE_URL=http://api:8080
INDEXER_LISTEN_ADDR=0.0.0.0:8081 INDEXER_LISTEN_ADDR=0.0.0.0:8081
INDEXER_SCAN_INTERVAL_SECONDS=5 INDEXER_SCAN_INTERVAL_SECONDS=5
# Backoffice Web UI
# Uses BACKOFFICE_PORT from above
# Meilisearch Search Engine # Meilisearch Search Engine
MEILI_URL=http://meilisearch:7700 MEILI_URL=http://meilisearch:7700
# PostgreSQL Database # PostgreSQL Database
# 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 DATABASE_URL=postgres://stripstream:stripstream@postgres:5432/stripstream
# ============================================================================= # =============================================================================
@@ -67,3 +47,13 @@ LIBRARIES_ROOT_PATH=/libraries
# Default: ../libraries (relative to infra/docker-compose.yml) # Default: ../libraries (relative to infra/docker-compose.yml)
# You can change this to an absolute path on your machine # You can change this to an absolute path on your machine
LIBRARIES_HOST_PATH=../libraries LIBRARIES_HOST_PATH=../libraries
# =============================================================================
# Port Configuration
# =============================================================================
# To change ports, edit docker-compose.yml directly:
# - API: change "7080:8080" to "YOUR_PORT:8080"
# - Indexer: change "7081:8081" to "YOUR_PORT:8081"
# - Backoffice: change "7082:8082" to "YOUR_PORT:8082"
# - Meilisearch: change "7700:7700" to "YOUR_PORT:7700"
# - PostgreSQL: change "6432:5432" to "YOUR_PORT:5432"

View File

@@ -6,7 +6,7 @@ services:
POSTGRES_USER: stripstream POSTGRES_USER: stripstream
POSTGRES_PASSWORD: stripstream POSTGRES_PASSWORD: stripstream
ports: ports:
- "${POSTGRES_PORT:-5432}:5432" - "6432:5432"
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
healthcheck: healthcheck:
@@ -20,7 +20,7 @@ services:
env_file: env_file:
- ../.env - ../.env
ports: ports:
- "${MEILI_PORT:-7700}:7700" - "7700:7700"
volumes: volumes:
- meili_data:/meili_data - meili_data:/meili_data
healthcheck: healthcheck:
@@ -54,7 +54,7 @@ services:
env_file: env_file:
- ../.env - ../.env
ports: ports:
- "${API_PORT:-8080}:8080" - "7080:8080"
volumes: volumes:
- ${LIBRARIES_HOST_PATH:-../libraries}:/libraries - ${LIBRARIES_HOST_PATH:-../libraries}:/libraries
depends_on: depends_on:
@@ -77,7 +77,7 @@ services:
env_file: env_file:
- ../.env - ../.env
ports: ports:
- "${INDEXER_PORT:-8081}:8081" - "7081:8081"
volumes: volumes:
- ${LIBRARIES_HOST_PATH:-../libraries}:/libraries - ${LIBRARIES_HOST_PATH:-../libraries}:/libraries
depends_on: depends_on:
@@ -103,7 +103,7 @@ services:
- PORT=8082 - PORT=8082
- HOST=0.0.0.0 - HOST=0.0.0.0
ports: ports:
- "${BACKOFFICE_PORT:-8082}:8082" - "7082:8082"
depends_on: depends_on:
api: api:
condition: service_healthy condition: service_healthy