Spaces:
Sleeping
Sleeping
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- 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 |
-
|
|
|
|
| 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
|