Spaces:
Running
Running
Commit Β·
a733d8f
1
Parent(s): fec9d49
Fix: backend waits for Neo4j bolt before starting uvicorn
Browse files- docker/supervisord.conf +1 -1
docker/supervisord.conf
CHANGED
|
@@ -40,7 +40,7 @@ priority=99
|
|
| 40 |
|
| 41 |
# ββ FastAPI backend ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
[program:backend]
|
| 43 |
-
command=python3 -m uvicorn main:app --host 127.0.0.1 --port 8000 --workers 2
|
| 44 |
directory=/app/backend
|
| 45 |
environment=
|
| 46 |
NEO4J_URI="bolt://127.0.0.1:7687",
|
|
|
|
| 40 |
|
| 41 |
# ββ FastAPI backend ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
[program:backend]
|
| 43 |
+
command=bash -c "until (echo > /dev/tcp/127.0.0.1/7687) 2>/dev/null; do echo '[backend-wait] Neo4j not ready, retrying...'; sleep 5; done && echo '[backend-wait] Neo4j bolt ready β starting uvicorn' && python3 -m uvicorn main:app --host 127.0.0.1 --port 8000 --workers 2"
|
| 44 |
directory=/app/backend
|
| 45 |
environment=
|
| 46 |
NEO4J_URI="bolt://127.0.0.1:7687",
|