mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
0d64b90fd0
Fix PUID/PGID collision issues by using gosu to run services with exact UID:GID. Changes include: - Added redis-start.sh and updated app-start.sh to load /etc/environment, determine PUID/PGID, and invoke gosu "$PUID:$PGID" to start Redis and the Next.js app (with verification and fallbacks). - Updated entrypoint.sh to persist PUID/PGID into /etc/environment, document the gosu approach, and adjust startup messaging. - Updated supervisord.conf to run the new startup wrappers as root (so they can use gosu) instead of running processes directly as specific users. - Dockerfile updated to install gosu and copy the redis-start.sh wrapper. - Documentation updated (deployment/unified.md) describing the PUID collision bug, the root cause, and the gosu-based fix. This resolves cases where PUID collides with existing system users (e.g., nobody) which previously caused processes to run with the wrong GID and produce EACCES errors.
49 lines
1.0 KiB
Plaintext
49 lines
1.0 KiB
Plaintext
[supervisord]
|
|
nodaemon=true
|
|
user=root
|
|
logfile=/dev/null
|
|
logfile_maxbytes=0
|
|
loglevel=info
|
|
pidfile=/var/run/supervisord.pid
|
|
|
|
[program:postgresql]
|
|
command=/usr/lib/postgresql/16/bin/postgres -D /var/lib/postgresql/data
|
|
user=postgres
|
|
autostart=true
|
|
autorestart=true
|
|
priority=10
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
stdout_events_enabled=true
|
|
stderr_events_enabled=true
|
|
|
|
[program:redis]
|
|
command=/app/redis-start.sh
|
|
user=root
|
|
autostart=true
|
|
autorestart=true
|
|
priority=20
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
stdout_events_enabled=true
|
|
stderr_events_enabled=true
|
|
|
|
[program:app]
|
|
command=/app/app-start.sh
|
|
directory=/app
|
|
user=root
|
|
autostart=true
|
|
autorestart=true
|
|
priority=30
|
|
environment=NODE_ENV="production",PORT="3030",HOSTNAME="0.0.0.0"
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
stdout_events_enabled=true
|
|
stderr_events_enabled=true
|