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

+114
View File
@@ -0,0 +1,114 @@
# Mindnet ENTWICKLUNG als Container: isoliert von Produktion.
#
# docker compose -f deploy/compose.dev.yml --env-file deploy/env/dev.env up -d --wait
#
# - Eigene Qdrant-Instanz mit eigenem Volume (Prod-Qdrant wird nie angesprochen).
# - Vault: nur Testdaten, nur lesend.
# - Ollama ist ein gemeinsamer Host-Dienst (Embeddings).
# - Andere Ports und anderer Compose-Projektname als Prod.
name: mindnet-dev
x-hardening: &hardening
image: mindnet:${MINDNET_IMAGE_TAG:-dev}
build:
context: ..
dockerfile: deploy/Dockerfile
target: runtime
env_file: [env/dev.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-dev]
x-fixed-env: &fixed-env
MINDNET_ENV: dev
COLLECTION_PREFIX: mindnet_dev
QDRANT_URL: http://qdrant:6333
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:
qdrant:
image: qdrant/qdrant:v1.16.2@sha256:dab6de32f7b2cc599985a7c764db3e8b062f70508fb85ca074aa856f829bf335
restart: unless-stopped
environment:
QDRANT__TELEMETRY_DISABLED: "true"
volumes:
- qdrant:/qdrant/storage
# Standardmäßig nicht veröffentlicht; zum Debuggen optional lokal am Host.
ports: ["127.0.0.1:${MINDNET_DEV_QDRANT_PORT:-6343}:6333"]
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/6333"]
interval: 10s
timeout: 5s
retries: 10
networks: [mindnet-dev]
api:
<<: *hardening
command: ["api"]
environment:
<<: *fixed-env
volumes:
- type: bind
source: ${MINDNET_VAULT_HOST_PATH:?MINDNET_VAULT_HOST_PATH auf ein Testdaten-Verzeichnis setzen}
target: /vault
read_only: true
bind:
create_host_path: false
propagation: rslave
- logs:/app/logs
- data:/app/data
ports: ["127.0.0.1:${MINDNET_API_PORT:-8012}:8000"]
mem_limit: ${MINDNET_API_MEM_LIMIT:-2g}
depends_on:
qdrant: {condition: service_healthy}
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:-8512}: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:
qdrant:
logs:
data:
networks:
mindnet-dev:
driver: bridge