Files
mindnet/deploy/compose.prod.yml
T
LarsandClaude Opus 5.5 6cdad8b046 Run the containers with the systemd configuration, 1:1
The containers now read the unchanged .env of the matching systemd instance
(/home/llmadmin/mindnet_dev/.env, /home/llmadmin/mindnet/.env) and use the
same Qdrant, Ollama, vault and collection prefix, so both can be compared
side by side. Only container-specific values are overridden: host service
addresses (host.docker.internal instead of 127.0.0.1) and the read-only vault.

- deploy/appenv.py derives the vault mount and prefix from that .env and
  rejects application keys in the container-only file.
- Remove the separate dev Qdrant, the synthetic test vault and the import step.
- UI binds 0.0.0.0 like systemd; API stays loopback by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 17:22:08 +01:00

101 lines
3.3 KiB
YAML

# Mindnet PRODUKTION als Container (Vorlage, noch NICHT aktiv): dieselbe Anwendung
# mit derselben Konfiguration wie die systemd-Prod-Instanz (8001/8501), parallel auf
# 8011/8511 zum Vergleich. Umschaltung erst mit Freigabe (Gate G5).
#
# Gestartet über deploy/deploy.sh prod. Zwei Dateien, beide nur auf dem Host:
# - MINDNET_APP_ENV_FILE: die unveränderte .env der systemd-Prod-Instanz
# - MINDNET_ENV_FILE: nur Container-Angaben (Ports, Bind-Adressen, Freigaben)
# Fest überschrieben wird nur, was im Container anders lauten muss: die Adressen
# der Host-Dienste (statt 127.0.0.1). Vault-Pfad und Präfix kommen aus der .env.
# Vault nur lesend, bis R2 (Pfadsicherheit beim Speichern) behoben ist.
name: mindnet-prod
x-hardening: &hardening
image: mindnet:${MINDNET_IMAGE_TAG:?MINDNET_IMAGE_TAG setzen (z. B. prod-<commit>)}
build:
context: ..
dockerfile: deploy/Dockerfile
target: runtime
env_file:
- ${MINDNET_APP_ENV_FILE:?MINDNET_APP_ENV_FILE auf die .env der systemd-Prod-Instanz setzen}
- ${MINDNET_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]
# Container-bedingte Werte; haben Vorrang vor beiden env-Dateien.
x-container-env: &container-env
MINDNET_ENV: prod
QDRANT_URL: http://host.docker.internal:6333
MINDNET_OLLAMA_URL: http://host.docker.internal:11434
VECTOR_DIM: "768"
MINDNET_EXPECTED_VECTOR_DIM: "768"
MINDNET_EXPECTED_EMBEDDING_MODEL: nomic-embed-text
MINDNET_VAULT_READONLY: "true"
services:
api:
<<: *hardening
command: ["api"]
environment:
<<: *container-env
volumes:
# Derselbe Vault wie systemd-Prod, eingehängt dort, wo MINDNET_VAULT_ROOT hinzeigt.
# Nur lesend, solange beide Instanzen parallel laufen.
- type: bind
source: ${MINDNET_VAULT_HOST_PATH:?wird von deploy/deploy.sh aus der .env abgeleitet}
target: ${MINDNET_VAULT_TARGET:?wird von deploy/deploy.sh aus der .env abgeleitet}
read_only: true
bind:
create_host_path: false
propagation: rslave
- logs:/app/logs
- data:/app/data
ports: ["${MINDNET_API_BIND:-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:
<<: *container-env
MINDNET_VAULT_REQUIRED: "false"
MINDNET_API_URL: http://api:8000
volumes:
- data:/app/data:ro
# Wie systemd (STREAMLIT_SERVER_ADDRESS=0.0.0.0): im LAN erreichbar.
ports: ["${MINDNET_UI_BIND:-0.0.0.0}:${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