copilot: docker optimize.
Some checks failed
Build and Push Docker Image / buildx (push) Has been cancelled

This commit is contained in:
2025-11-11 16:00:24 +08:00
parent 17bbbe7fbc
commit 7bc3e10b52
7 changed files with 40 additions and 29 deletions

15
scripts/entrypoint.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
# Ensure the data directory exists and is writable by the 'node' user.
# This runs as root inside the container during startup, fixes ownership for
# both named volumes and bind mounts, then drops privileges to the 'node' user.
DATA_DIR=/app/data
mkdir -p "$DATA_DIR"
chown -R node:node "$DATA_DIR" || true
chmod 755 "$DATA_DIR" || true
# Exec the requested command as the 'node' user
exec su-exec node "$@"