Indrajit Ari commited on
Commit
a6b2429
Β·
1 Parent(s): 6d4d91c

fix: delay nginx start by 20s to wait for Next.js and FastAPI to boot

Browse files
Files changed (1) hide show
  1. supervisord.conf +4 -1
supervisord.conf CHANGED
@@ -28,13 +28,16 @@ directory=/app/frontend
28
  environment=PORT="3000",NODE_ENV="production",NEXT_PUBLIC_API_URL=""
29
  autostart=true
30
  autorestart=true
 
31
  stdout_logfile=/var/log/supervisor/nextjs.log
32
  stderr_logfile=/var/log/supervisor/nextjs.log
33
 
34
  # ── nginx reverse proxy ──────────────────────────────────────────────────────
35
  [program:nginx]
36
- command=nginx -g "daemon off;"
 
37
  autostart=true
38
  autorestart=true
 
39
  stdout_logfile=/var/log/supervisor/nginx.log
40
  stderr_logfile=/var/log/supervisor/nginx.log
 
28
  environment=PORT="3000",NODE_ENV="production",NEXT_PUBLIC_API_URL=""
29
  autostart=true
30
  autorestart=true
31
+ startsecs=3
32
  stdout_logfile=/var/log/supervisor/nextjs.log
33
  stderr_logfile=/var/log/supervisor/nextjs.log
34
 
35
  # ── nginx reverse proxy ──────────────────────────────────────────────────────
36
  [program:nginx]
37
+ ; Wait for FastAPI and Next.js to be up before nginx starts
38
+ command=bash -c "sleep 20 && nginx -g 'daemon off;'"
39
  autostart=true
40
  autorestart=true
41
+ startsecs=21
42
  stdout_logfile=/var/log/supervisor/nginx.log
43
  stderr_logfile=/var/log/supervisor/nginx.log