Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat(app): wait for api to finish before launching front app

dextmorgne55d78e9fb7c
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 4d2f21a7..e46fcf9a 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -94,6 +94,11 @@ services:
condition: service_healthy
neo4j:
condition: service_healthy
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:5001/health"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
networks:
- flowsint_network
@@ -142,6 +147,9 @@ services:
- /app/node_modules
environment:
- VITE_API_URL=${VITE_API_URL}
+ depends_on:
+ api:
+ condition: service_healthy
networks:
- flowsint_network
stdin_open: true
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
index b64c9bb3..23c73016 100644
--- a/docker-compose.prod.yml
+++ b/docker-compose.prod.yml
@@ -91,6 +91,11 @@ services:
condition: service_healthy
neo4j:
condition: service_healthy
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:5001/health"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
networks:
- flowsint_network
@@ -136,7 +141,8 @@ services:
networks:
- flowsint_network
depends_on:
- - api
+ api:
+ condition: service_healthy
networks:
flowsint_network:
diff --git a/flowsint-api/app/main.py b/flowsint-api/app/main.py
index 49f751be..43e01788 100644
--- a/flowsint-api/app/main.py
+++ b/flowsint-api/app/main.py
@@ -40,6 +40,13 @@ app.add_middleware(
allow_headers=["*"],
)
+
+async def health():
+ """Health check endpoint for Docker healthcheck"""
+ return {"status": "ok"}
+
+
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
app.include_router(sketches.router, prefix="/api/sketches", tags=["sketches"])
app.include_router(