From 7f92a58fd70417692f9bf6d334b044ee59dad2de Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 2 Mar 2026 14:30:47 +0500 Subject: [PATCH] chore(v2): add PocketBase and MinIO services to docker-compose --- docker-compose.yml | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 750c534..de31555 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,60 @@ version: "3.9" services: + # ─── MinIO (object storage for chapter .md files + audio cache) ───────────── + minio: + image: minio/minio:latest + container_name: libnovel-minio + restart: unless-stopped + command: server /data --console-address ":9001" + environment: + MINIO_ROOT_USER: "${MINIO_ROOT_USER:-admin}" + MINIO_ROOT_PASSWORD: "${MINIO_ROOT_PASSWORD:-changeme123}" + ports: + - "9000:9000" # S3 API + - "9001:9001" # Web console + volumes: + - minio_data:/data + healthcheck: + test: ["CMD", "mc", "ready", "local"] + interval: 10s + timeout: 5s + retries: 5 + + # ─── MinIO bucket initialisation ───────────────────────────────────────────── + # Runs once to create the default buckets and then exits. + minio-init: + image: minio/mc:latest + container_name: libnovel-minio-init + depends_on: + minio: + condition: service_healthy + entrypoint: > + /bin/sh -c " + mc alias set local http://minio:9000 $${MINIO_ROOT_USER:-admin} $${MINIO_ROOT_PASSWORD:-changeme123}; + mc mb --ignore-existing local/libnovel-chapters; + mc mb --ignore-existing local/libnovel-audio; + echo 'buckets ready'; + " + environment: + MINIO_ROOT_USER: "${MINIO_ROOT_USER:-admin}" + MINIO_ROOT_PASSWORD: "${MINIO_ROOT_PASSWORD:-changeme123}" + + # ─── PocketBase (auth + structured data: books, chapters index, ranking, progress) ── + pocketbase: + image: ghcr.io/muchobien/pocketbase:latest + container_name: libnovel-pocketbase + restart: unless-stopped + ports: + - "8090:8090" + volumes: + - pb_data:/pb/pb_data + healthcheck: + test: ["CMD", "wget", "-qO-", "http://localhost:8090/api/health"] + interval: 10s + timeout: 5s + retries: 5 + # ─── Browserless ──────────────────────────────────────────────────────────── browserless: image: ghcr.io/browserless/chromium:latest @@ -53,6 +107,10 @@ services: depends_on: kokoro: condition: service_healthy + pocketbase: + condition: service_healthy + minio: + condition: service_healthy environment: BROWSERLESS_URL: "http://browserless:3000" BROWSERLESS_TOKEN: "${BROWSERLESS_TOKEN:-}" @@ -68,6 +126,17 @@ services: # Kokoro-FastAPI TTS endpoint. KOKORO_URL: "${KOKORO_URL:-http://localhost:8880}" KOKORO_VOICE: "${KOKORO_VOICE:-af_bella}" + # MinIO / S3 object storage + MINIO_ENDPOINT: "minio:9000" + MINIO_ACCESS_KEY: "${MINIO_ROOT_USER:-admin}" + MINIO_SECRET_KEY: "${MINIO_ROOT_PASSWORD:-changeme123}" + MINIO_USE_SSL: "false" + MINIO_BUCKET_CHAPTERS: "${MINIO_BUCKET_CHAPTERS:-libnovel-chapters}" + MINIO_BUCKET_AUDIO: "${MINIO_BUCKET_AUDIO:-libnovel-audio}" + # PocketBase + POCKETBASE_URL: "http://pocketbase:8090" + POCKETBASE_ADMIN_EMAIL: "${POCKETBASE_ADMIN_EMAIL:-admin@libnovel.local}" + POCKETBASE_ADMIN_PASSWORD: "${POCKETBASE_ADMIN_PASSWORD:-changeme123}" ports: - "8080:8080" volumes: @@ -80,3 +149,5 @@ services: volumes: static_books: + minio_data: + pb_data: