fix(docker): add entrypoint for volume permission handling

Add docker-entrypoint.sh that runs as root at startup, fixes ownership
of the DATA_DIR volume (only files with wrong user or group), then drops
to the non-root sencho user via su-exec before starting Node.

This eliminates the SQLITE_READONLY crash that occurs when a host-mounted
data volume was created by root or chowned to the wrong UID. The pattern
mirrors the official PostgreSQL, Redis, and MariaDB Docker images.

- Install su-exec in Stage 3 (10KB Alpine tool, idiomatic alternative to gosu)
- Remove USER directive; entrypoint handles the privilege drop instead
- Use ENTRYPOINT + CMD so Node becomes PID 1 (correct SIGTERM handling)
- Add .gitattributes to enforce LF line endings for *.sh files
This commit is contained in:
SaelixCode
2026-03-22 15:16:34 -04:00
parent 2a444bde99
commit 593a709197
4 changed files with 57 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
# Force LF line endings for shell scripts regardless of the developer's OS.
# Shell scripts with CRLF endings will fail with "exec format error" in Linux containers.
*.sh text eol=lf