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:
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user