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>
99 lines
3.1 KiB
YAML
99 lines
3.1 KiB
YAML
# Mindnet ENTWICKLUNG als Container: dieselbe Anwendung mit derselben Konfiguration
|
|
# wie die systemd-Dev-Instanz (8002/8502), parallel auf 8012/8512 zum Vergleich.
|
|
#
|
|
# Gestartet über deploy/deploy.sh dev. Zwei Dateien, beide nur auf dem Host:
|
|
# - MINDNET_APP_ENV_FILE: die unveränderte .env der systemd-Dev-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.
|
|
|
|
name: mindnet-dev
|
|
|
|
x-hardening: &hardening
|
|
image: mindnet:${MINDNET_IMAGE_TAG:-dev}
|
|
build:
|
|
context: ..
|
|
dockerfile: deploy/Dockerfile
|
|
target: runtime
|
|
env_file:
|
|
- ${MINDNET_APP_ENV_FILE:?MINDNET_APP_ENV_FILE auf die .env der systemd-Dev-Instanz setzen}
|
|
- ${MINDNET_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]
|
|
|
|
# Container-bedingte Werte; haben Vorrang vor beiden env-Dateien.
|
|
x-container-env: &container-env
|
|
MINDNET_ENV: dev
|
|
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-Dev, 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:-8012}: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:-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:
|
|
logs:
|
|
data:
|
|
|
|
networks:
|
|
mindnet-dev:
|
|
driver: bridge
|