perf: feature-gate smart deps, drop ONNX/qdrant from backend binary

wiring `smart` feature gates fastembed+qdrant; bootstrap no longer
links ONNX Runtime (~300 MiB RSS savings). prod compose stripped
to backend-only (no worker/qdrant).
This commit is contained in:
2026-08-08 15:23:39 +02:00
parent 425376874c
commit c7e1a867ed
5 changed files with 39 additions and 70 deletions

View File

@@ -9,58 +9,18 @@ services:
- HOST=0.0.0.0
- PORT=3000
- ALLOW_REGISTRATION=false
- NATS_URL=nats://k_nats:4222
- QDRANT_URL=http://qdrant:6334
- QDRANT_COLLECTION=notes
# SPA is bundled in the image at /app/frontend/dist (set in Dockerfile)
# Override here only if you move the dist elsewhere:
# - SPA_DIR=/app/frontend/dist
volumes:
- ./data:/app/data
networks:
- traefik
- shared-services
- internal
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
# Both the app domain and the API subdomain point to the same service.
# The backend serves /api/v1/* and falls back to the SPA for everything else.
- "traefik.http.routers.knotes.rule=Host(`knotes.gabrielkaszewski.dev`) || Host(`api.knotes.gabrielkaszewski.dev`)"
- "traefik.http.routers.knotes.entrypoints=websecure"
- "traefik.http.routers.knotes.tls.certresolver=letsencrypt"
- "traefik.http.services.knotes.loadbalancer.server.port=3000"
worker:
image: registry.gabrielkaszewski.dev/k-notes:latest
command: ["./worker"]
environment:
- DATABASE_URL=sqlite:///app/data/notes.db
- NATS_URL=nats://k_nats:4222
- QDRANT_URL=http://qdrant:6334
- ENABLE_EMBEDDINGS=true
depends_on:
- backend
- qdrant
volumes:
- ./data:/app/data
networks:
- internal
- shared-services
qdrant:
image: qdrant/qdrant:latest
container_name: k_notes_qdrant
volumes:
- ./data/qdrant_storage:/qdrant/storage:z
restart: unless-stopped
networks:
- internal
networks:
traefik:
external: true
shared-services:
external: true
internal:
driver: bridge