Deploy compose: shared DB bind mount, models on NFS
- deploy/compose.yaml: KANAME_DATA_DIR bind mount (SQLite) for web and worker, NFSv4 volume for models (worker only), configured via .env - entrypoint fails fast with a chown hint if /data or /models isn't writable - .env.example and README document the server storage layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fbcdcf2e2d
commit
e73b019492
5 files changed
+51
-6
No files matched your search
+19
-5
@@ -1,20 +1,34 @@
|
||||
# Server setup: put this file and a filled-in .env (from .env.example) in a folder, then
|
||||
# mkdir -p data && sudo chown 1000:1000 data
|
||||
# docker compose pull && docker compose up -d
|
||||
name: kaname
|
||||
|
||||
services:
|
||||
worker:
|
||||
image: git.linxweiler.xyz/pascallinxweiler/kaname:${KANAME_VERSION:-latest}
|
||||
command: worker
|
||||
env_file: .env
|
||||
volumes: [data:/data, models:/models]
|
||||
volumes:
|
||||
- ${KANAME_DATA_DIR:-./data}:/data
|
||||
- models:/models
|
||||
restart: unless-stopped
|
||||
|
||||
web:
|
||||
image: git.linxweiler.xyz/pascallinxweiler/kaname:${KANAME_VERSION:-latest}
|
||||
env_file: .env
|
||||
ports: ["3000:3000"]
|
||||
volumes: [data:/data]
|
||||
ports: ["${WEB_PORT:-3000}:3000"]
|
||||
volumes:
|
||||
- ${KANAME_DATA_DIR:-./data}:/data
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
data: # SQLite + hf home: keep on local disk
|
||||
models: # downloaded models (later: NFS from TrueNAS)
|
||||
# Downloaded models on the NAS (only the worker mounts it). NFSv4 because hf uses file locks;
|
||||
# "hard" makes writes wait while the NAS is unreachable instead of failing half-written.
|
||||
# Docker keeps these options once the volume exists: after changing them, run
|
||||
# `docker compose down && docker volume rm kaname_models` (files on the NAS are not touched).
|
||||
models:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: nfs
|
||||
o: "addr=${NFS_SERVER:?set NFS_SERVER in .env},nfsvers=4.1,rw,hard,noatime"
|
||||
device: ":${NFS_EXPORT:?set NFS_EXPORT in .env}"
|
||||
Reference in new issue
Block a user