- 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
14 lines
318 B
Bash
Executable File
14 lines
318 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
echo "[entrypoint] Starting up..."
|
|
|
|
# Ensure data directory exists and is writable by the node user
|
|
mkdir -p /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 "$@"
|