From 9c115f00c4d14e319d6216c3ecffe64482e25da2 Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 2 Mar 2026 15:13:26 +0500 Subject: [PATCH] chore: remove kokoro from compose, make host ports env-configurable - Drop kokoro service (deployed separately); update default KOKORO_URL to kokoro.kalekber.cc - Expose host ports via env vars (MINIO_PORT, MINIO_CONSOLE_PORT, POCKETBASE_PORT, BROWSERLESS_PORT, SCRAPER_PORT) for preview deployments --- docker-compose.yml | 29 ++++++----------------------- scraper/cmd/scraper/main.go | 2 +- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index de31555..d0df6cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,8 +11,8 @@ services: MINIO_ROOT_USER: "${MINIO_ROOT_USER:-admin}" MINIO_ROOT_PASSWORD: "${MINIO_ROOT_PASSWORD:-changeme123}" ports: - - "9000:9000" # S3 API - - "9001:9001" # Web console + - "${MINIO_PORT:-9000}:9000" # S3 API + - "${MINIO_CONSOLE_PORT:-9001}:9001" # Web console volumes: - minio_data:/data healthcheck: @@ -46,7 +46,7 @@ services: container_name: libnovel-pocketbase restart: unless-stopped ports: - - "8090:8090" + - "${POCKETBASE_PORT:-8090}:8090" volumes: - pb_data:/pb/pb_data healthcheck: @@ -73,7 +73,7 @@ services: # Optional webhook URL for Browserless error alerts. ERROR_ALERT_URL: "${ERROR_ALERT_URL:-}" ports: - - "3030:3000" + - "${BROWSERLESS_PORT:-3030}:3000" # Shared memory is required for Chrome. shm_size: "2gb" healthcheck: @@ -82,21 +82,6 @@ services: timeout: 5s retries: 5 - # ─── Kokoro-FastAPI (TTS) ──────────────────────────────────────────────────── - # CPU image; swap for ghcr.io/remsky/kokoro-fastapi-gpu:latest on NVIDIA hosts. - # Models are baked in — no volume mount required for the default voice set. - kokoro: - image: ghcr.io/remsky/kokoro-fastapi-cpu:latest - container_name: libnovel-kokoro - restart: unless-stopped - ports: - - "8880:8880" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8880/health"] - interval: 15s - timeout: 5s - retries: 5 - # ─── Scraper ───────────────────────────────────────────────────────────────── scraper: build: @@ -105,8 +90,6 @@ services: container_name: libnovel-scraper restart: unless-stopped depends_on: - kokoro: - condition: service_healthy pocketbase: condition: service_healthy minio: @@ -124,7 +107,7 @@ services: SCRAPER_HTTP_ADDR: ":8080" LOG_LEVEL: "debug" # Kokoro-FastAPI TTS endpoint. - KOKORO_URL: "${KOKORO_URL:-http://localhost:8880}" + KOKORO_URL: "${KOKORO_URL:-https://kokoro.kalekber.cc}" KOKORO_VOICE: "${KOKORO_VOICE:-af_bella}" # MinIO / S3 object storage MINIO_ENDPOINT: "minio:9000" @@ -138,7 +121,7 @@ services: POCKETBASE_ADMIN_EMAIL: "${POCKETBASE_ADMIN_EMAIL:-admin@libnovel.local}" POCKETBASE_ADMIN_PASSWORD: "${POCKETBASE_ADMIN_PASSWORD:-changeme123}" ports: - - "8080:8080" + - "${SCRAPER_PORT:-8080}:8080" volumes: - static_books:/app/static/books healthcheck: diff --git a/scraper/cmd/scraper/main.go b/scraper/cmd/scraper/main.go index 326e0e0..76b6760 100644 --- a/scraper/cmd/scraper/main.go +++ b/scraper/cmd/scraper/main.go @@ -177,7 +177,7 @@ func run(log *slog.Logger) error { case "serve": addr := envOr("SCRAPER_HTTP_ADDR", ":8080") - kokoroURL := envOr("KOKORO_URL", "") + kokoroURL := envOr("KOKORO_URL", "https://kokoro.kalekber.cc") kokoroVoice := envOr("KOKORO_VOICE", "af_bella") log.Info("starting HTTP server", "addr", addr,