- 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>
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
# 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:
|
|
- ${KANAME_DATA_DIR:-./data}:/data
|
|
- models:/models
|
|
restart: unless-stopped
|
|
|
|
web:
|
|
image: git.linxweiler.xyz/pascallinxweiler/kaname:${KANAME_VERSION:-latest}
|
|
env_file: .env
|
|
ports: ["${WEB_PORT:-3000}:3000"]
|
|
volumes:
|
|
- ${KANAME_DATA_DIR:-./data}:/data
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
# 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}"
|