Skip to content

Commit 76a59a8

Browse files
committed
Add health check endpoint and fix docker-compose healthcheck configuration
1 parent 1a3c7b1 commit 76a59a8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docker-compose.production-pinned.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
version: '3.8'
22

3-
services:
3+
healthcheck:
4+
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
5+
interval: 30s
6+
timeout: 10s
7+
retries: 3
8+
start_period: 40ses:
49
webuiflasher:
510
image: ghcr.io/the78mole/webuiflasher:v1.0.0
611
container_name: webuiflasher-pinned

scripts/webflasher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ def get_firmware_list() -> list[dict]:
166166

167167

168168
# API Routes - diese müssen vor dem Static Mount stehen
169+
@app.get("/health")
170+
async def health_check():
171+
"""Health check endpoint for Docker containers."""
172+
return {"status": "healthy", "service": "WebUIFlasher"}
173+
174+
169175
@app.get("/api/firmware", response_model=list[dict])
170176
async def api_get_firmware():
171177
"""Get list of available firmware as JSON."""

0 commit comments

Comments
 (0)