Prepare containerized dev/prod deployment (inactive)

Add a Docker image and separate Compose projects for development and
production, based on the stable main behaviour without the privacy
gateway. Nothing is wired into the existing systemd deploy workflow.

- One non-root image (api | ui | preflight), base image pinned by
  digest, dependencies from a hash-locked universal lock without torch
  and sentence-transformers (MiniLM is not on the runtime path)
- Preflight aborts on: VECTOR_DIM != 768 or non-nomic embedding
  profile, implicit or cross-env collection prefix, cloud keys without
  explicit egress acknowledgement, missing/empty or writable vault mount
- Vault is a read-only NAS bind mount without host-path autocreation;
  healthcheck turns unhealthy when the vault sentinel disappears
- Dev runs its own Qdrant; prod reuses the existing host instance
- API published on loopback only; read-only rootfs, cap_drop ALL,
  no-new-privileges
- Dev workflow kept as an inactive template outside .gitea/workflows
- Docs: operations guide and migration plan with release gates, test
  baseline classification, R2/R3 and privacy gateway requirements

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-10-28 14:33:18 +01:00
1 parent 0d61a9e191
commit 7a225ba2b6
18 files changed
+2864

No files matched your search

+97
View File
@@ -0,0 +1,97 @@
# Mindnet PRODUKTION als Container (Vorbereitung, noch NICHT aktiv).
#
# docker compose -f deploy/compose.prod.yml --env-file deploy/env/prod.env up -d --wait
#
# Grenzen dieses Stands (siehe docs/04_Operations/04_docker_deployment.md):
# - Nutzt die bestehende produktive Qdrant-Instanz auf dem Host, startet KEINE eigene.
# - Vault ist zwingend schreibgeschützt, bis R2 (Pfad-Traversal in /ingest/save) behoben ist.
# - Ollama ist ein gemeinsamer Host-Dienst (Embeddings), kein Teil dieses Stacks.
# - Ports weichen bewusst von den systemd-Diensten (8001/8501) ab, damit nichts kollidiert.
# - Start auf llm-node erfordert eine gesonderte Freigabe.
name: mindnet-prod
x-hardening: &hardening
image: mindnet:${MINDNET_IMAGE_TAG:?MINDNET_IMAGE_TAG setzen (z. B. Git-SHA)}
build:
context: ..
dockerfile: deploy/Dockerfile
target: runtime
env_file: [env/prod.env]
read_only: true
tmpfs: ["/tmp:size=64m,mode=1777"]
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
init: true
pids_limit: 256
restart: unless-stopped
extra_hosts: ["host.docker.internal:host-gateway"]
logging:
driver: json-file
options: {max-size: "10m", max-file: "3"}
networks: [mindnet-prod]
# Werte, die nicht per env-Datei überschrieben werden dürfen.
x-fixed-env: &fixed-env
MINDNET_ENV: prod
VECTOR_DIM: "768"
MINDNET_EXPECTED_VECTOR_DIM: "768"
MINDNET_EXPECTED_EMBEDDING_MODEL: nomic-embed-text
MINDNET_VAULT_ROOT: /vault
MINDNET_VAULT_READONLY: "true"
MINDNET_VOCAB_PATH: /vault/_system/dictionary/edge_vocabulary.md
MINDNET_SCHEMA_PATH: /vault/_system/dictionary/graph_schema.md
services:
api:
<<: *hardening
command: ["api"]
environment:
<<: *fixed-env
volumes:
- type: bind
source: ${MINDNET_VAULT_HOST_PATH:?MINDNET_VAULT_HOST_PATH setzen (NAS-Mount auf dem Host)}
target: /vault
read_only: true
bind:
create_host_path: false
propagation: rslave
- logs:/app/logs
- data:/app/data
# API ohne Authentisierung: nur lokal am Host veröffentlichen.
ports: ["127.0.0.1:${MINDNET_API_PORT:-8011}:8000"]
mem_limit: ${MINDNET_API_MEM_LIMIT:-2g}
healthcheck:
test: ["CMD", "python", "/opt/mindnet/healthcheck.py", "api"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
ui:
<<: *hardening
command: ["ui"]
environment:
<<: *fixed-env
MINDNET_VAULT_REQUIRED: "false"
MINDNET_API_URL: http://api:8000
volumes:
- data:/app/data:ro
ports: ["${MINDNET_UI_BIND:-127.0.0.1}:${MINDNET_UI_PORT:-8511}:8501"]
mem_limit: ${MINDNET_UI_MEM_LIMIT:-1g}
depends_on:
api: {condition: service_healthy}
healthcheck:
test: ["CMD", "python", "/opt/mindnet/healthcheck.py", "ui"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
logs:
data:
networks:
mindnet-prod:
driver: bridge