Fix Docker bootstrap: supervisord socket not configured

supervisord.conf was missing [unix_http_server], [supervisorctl], and
[rpcinterface:supervisor] sections, so the Unix socket was never created.
This caused the readiness check to always fail and the container to exit
with "Supervisord failed to start".

- Add missing supervisord socket and RPC configuration sections
- Improve bootstrap readiness check to verify both process and socket
- Add early exit if supervisord process dies unexpectedly
- Simplify supervisorctl calls (config path no longer needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mariano Silva
2026-03-21 18:38:42 -03:00
parent 08e85a3827
commit 9156cece88
2 changed files with 19 additions and 5 deletions
+9 -5
View File
@@ -146,23 +146,27 @@ if [ ! -f "$SEED_MARKER" ]; then
fi fi
fi fi
# Wait for supervisord socket to be ready # Wait for supervisord to be ready
echo "▶ Waiting for supervisord..." echo "▶ Waiting for supervisord..."
for i in $(seq 1 30); do for i in $(seq 1 30); do
if supervisorctl -c /etc/supervisor/conf.d/supervisord.conf status >/dev/null 2>&1; then if kill -0 $SUPERVISOR_PID 2>/dev/null && [ -S /var/run/supervisor.sock ]; then
echo "✓ Supervisord is ready" echo "✓ Supervisord is ready"
break break
fi fi
if ! kill -0 $SUPERVISOR_PID 2>/dev/null; then
echo "✗ Supervisord process died"
exit 1
fi
if [ $i -eq 30 ]; then if [ $i -eq 30 ]; then
echo "✗ Supervisord failed to start" echo "✗ Supervisord socket not available after 30s"
exit 1 exit 1
fi fi
sleep 1 sleep 1
done done
# Start Next.js # Start Next.js via supervisorctl
echo "▶ Starting Next.js..." echo "▶ Starting Next.js..."
supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start nextjs supervisorctl start nextjs
echo "" echo ""
echo "╔═══════════════════════════════════════════════════════════════╗" echo "╔═══════════════════════════════════════════════════════════════╗"
+10
View File
@@ -1,3 +1,13 @@
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisord] [supervisord]
nodaemon=true nodaemon=true
user=root user=root