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
+10
-1
@@ -4,11 +4,20 @@ set -e
|
||||
|
||||
role="${1:-web}"
|
||||
|
||||
require_writable() {
|
||||
if ! touch "$1/.write-test" 2>/dev/null; then
|
||||
echo "ERROR: $1 is not writable by uid $(id -u). On the host: chown -R $(id -u):$(id -g) <folder mounted at $1>" >&2
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$1/.write-test"
|
||||
}
|
||||
|
||||
case "$role" in
|
||||
web|worker)
|
||||
echo "$role" > /tmp/kaname-role
|
||||
require_writable /data
|
||||
if [ "$role" = worker ]; then require_writable "${MODELS_DIR:-/models}"; fi
|
||||
# web and worker usually start together; the lock makes sure only one runs the migrations.
|
||||
mkdir -p /data
|
||||
flock /data/.migrate.lock node dist/migrate.mjs
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in new issue
Block a user