Fix silent Docker crash: recursive chown, db error handling

- Entrypoint: chown -R /data (not just the directory) so existing
  volume files owned by root become writable by node user
- Entrypoint: add echo logging so startup progress is visible
- db.js: verify /data is writable before opening SQLite
- db.js: wrap Database() constructor in try-catch with clear error
  message instead of crashing silently at ESM import time
This commit is contained in:
MayaTheShy
2026-03-22 21:22:30 -04:00
parent 1b0b1c570d
commit 96afe8dcb7
2 changed files with 25 additions and 3 deletions

View File

@@ -1,9 +1,13 @@
#!/bin/sh
set -e
echo "[entrypoint] Starting up..."
# Ensure data directory exists and is writable by the node user
mkdir -p /data
chown node:node /data
chown -R node:node /data
echo "[entrypoint] /data permissions fixed"
# Drop privileges and exec the CMD
echo "[entrypoint] Dropping to user 'node', running: $*"
exec su-exec node "$@"