From 9156cece88a07c10592e49d6cc3e3b0ec4a8b2ce Mon Sep 17 00:00:00 2001 From: Mariano Silva Date: Sat, 21 Mar 2026 18:38:42 -0300 Subject: [PATCH] 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) --- docker/bootstrap.sh | 14 +++++++++----- docker/supervisord.conf | 10 ++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docker/bootstrap.sh b/docker/bootstrap.sh index 943afba3..9e5996e7 100644 --- a/docker/bootstrap.sh +++ b/docker/bootstrap.sh @@ -146,23 +146,27 @@ if [ ! -f "$SEED_MARKER" ]; then fi fi -# Wait for supervisord socket to be ready +# Wait for supervisord to be ready echo "▶ Waiting for supervisord..." 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" break fi + if ! kill -0 $SUPERVISOR_PID 2>/dev/null; then + echo "✗ Supervisord process died" + exit 1 + fi if [ $i -eq 30 ]; then - echo "✗ Supervisord failed to start" + echo "✗ Supervisord socket not available after 30s" exit 1 fi sleep 1 done -# Start Next.js +# Start Next.js via supervisorctl echo "▶ Starting Next.js..." -supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start nextjs +supervisorctl start nextjs echo "" echo "╔═══════════════════════════════════════════════════════════════╗" diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 25d4fbf6..deab710b 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -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] nodaemon=true user=root