From 2dfc0525a6c09dce4ca4ed91df1c4456752c1e15 Mon Sep 17 00:00:00 2001 From: Senko-san Date: Sun, 7 Jun 2026 21:04:53 +0300 Subject: [PATCH] chore: ports --- .env.example | 9 +++++++-- docker-compose.yml | 16 ++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index d29c2cd..cf368fd 100644 --- a/.env.example +++ b/.env.example @@ -5,12 +5,17 @@ # Per-repo .env.example files still exist for running a service standalone. # ====================================================================== +# ---- Ports ----------------------------------------------------------- +NGINX_PORT=8881 # main entrypoint (browser) +API_PORT=8000 # direct backend access (debug / docs) +WEBUI_PORT=3000 # rsbuild dev server (internal; proxied through nginx) +POSTGRES_PORT=5432 +REDIS_PORT=6379 + # ---- Postgres (db service) ------------------------------------------- POSTGRES_USER=mcma POSTGRES_PASSWORD=mcma POSTGRES_DB=mcma -POSTGRES_PORT=5432 -REDIS_PORT=6379 # ---- Backend (api + worker) ------------------------------------------ ENVIRONMENT=dev # dev | test | prod diff --git a/docker-compose.yml b/docker-compose.yml index 118e928..38bb31e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,12 +54,12 @@ services: DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-mcma}:${POSTGRES_PASSWORD:-mcma}@db:5432/${POSTGRES_DB:-mcma} REDIS_URL: redis://redis:6379/0 volumes: - - ./mcma-backend:/app # live source (hot reload) - - /app/.venv # keep the image's venv, don't shadow it + - ./mcma-backend:/app # live source (hot reload) + - /app/.venv # keep the image's venv, don't shadow it - media:/data/media - transcode_cache:/data/transcode-cache ports: - - "8000:8000" # direct access for debugging / docs + - "${API_PORT:-8000}:8000" # direct access for debugging / docs depends_on: db: { condition: service_healthy } redis: { condition: service_healthy } @@ -91,21 +91,21 @@ services: env_file: .env environment: RSBUILD_HOST: 0.0.0.0 - RSBUILD_PORT: "3000" + RSBUILD_PORT: "${WEBUI_PORT:-3000}" # Browser reaches HMR through nginx on :80, not the container's :3000. - RSBUILD_HMR_CLIENT_PORT: "80" + RSBUILD_HMR_CLIENT_PORT: "${NGINX_PORT:-8881}" volumes: - ./mcma-webui:/app - - /app/node_modules # keep the image's install, don't shadow it + - /app/node_modules # keep the image's install, don't shadow it expose: - - "3000" + - "${WEBUI_PORT:-3000}" restart: unless-stopped # -- reverse proxy: single entrypoint at localhost:80 --------------------- nginx: image: nginx:1.27-alpine ports: - - "80:80" + - "${NGINX_PORT:-8881}:80" volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro depends_on: