00466a9801
Introduces a manifest contract so feature containers self-describe their settings (JSON Schema + access rules). Backend and frontend gain generic plugin proxy and dynamic Extensions UI with zero feature-specific code. Doc-service is the first plugin consumer: exposes /plugin/manifest and /plugin/settings, adds a watchdog-based file watcher that auto-ingests PDFs from a mounted directory, maps subfolders to categories, supports AI-suggested folder/filename (user-confirmed), and enforces a no-remove policy. Access is gated by is_superuser or doc-service-admin group. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
111 lines
3.7 KiB
YAML
111 lines
3.7 KiB
YAML
services:
|
|
|
|
# ── Database ────────────────────────────────────────────────────────────────
|
|
db:
|
|
image: postgres:16-alpine
|
|
user: "70:70" # postgres user UID:GID in alpine image (fixed by image)
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-destroying_sap}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
networks:
|
|
- backend-net
|
|
|
|
# ── Backend (management) ────────────────────────────────────────────────────
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
network: host
|
|
user: "1001:1001"
|
|
restart: unless-stopped
|
|
env_file: ./backend/.env
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-destroying_sap}
|
|
DOC_SERVICE_URL: http://doc-service:8001
|
|
AI_SERVICE_URL: http://ai-service:8010
|
|
volumes:
|
|
- app_config:/config
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- backend-net
|
|
|
|
# ── AI service (shared AI provider intermediary) ─────────────────────────────
|
|
ai-service:
|
|
build:
|
|
context: ./features/ai-service
|
|
dockerfile: Dockerfile
|
|
network: host
|
|
user: "1001:1001"
|
|
restart: unless-stopped
|
|
environment:
|
|
CONFIG_PATH: /config/ai_service_config.json
|
|
volumes:
|
|
- app_config:/config
|
|
networks:
|
|
- backend-net
|
|
|
|
# ── Doc service (PDF extraction) ────────────────────────────────────────────
|
|
doc-service:
|
|
build:
|
|
context: ./features/doc-service
|
|
dockerfile: Dockerfile
|
|
network: host
|
|
user: "1001:1001"
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-destroying_sap}
|
|
DATA_DIR: /data/documents
|
|
CONFIG_PATH: /config/doc_service_config.json
|
|
AI_SERVICE_URL: http://ai-service:8010
|
|
volumes:
|
|
- doc_data:/data/documents
|
|
- watch_data:/data/watch
|
|
- app_config:/config
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ai-service:
|
|
condition: service_started
|
|
networks:
|
|
- backend-net
|
|
|
|
# ── Frontend (UI) ────────────────────────────────────────────────────────────
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
network: host
|
|
user: "1001:1001"
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:8080"
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- backend-net
|
|
- frontend-net
|
|
|
|
volumes:
|
|
postgres_data:
|
|
doc_data: # PDF files persisted across restarts
|
|
watch_data: # Watch directory — bind-mount your NAS/Nextcloud here via docker-compose.override.yml
|
|
app_config: # Per-service runtime config JSON files
|
|
|
|
networks:
|
|
# backend-net: db ↔ backend ↔ doc-service. No host ports bound.
|
|
# internal:true removed — doc-service needs outbound access for cloud AI providers.
|
|
backend-net:
|
|
# External-facing: only the frontend binds a host port through this network.
|
|
frontend-net:
|