feat: add healthcheck endpoint

This commit is contained in:
2026-01-13 14:52:57 +01:00
parent 5ffbc2e3d3
commit 352212c0e0
3 changed files with 21 additions and 0 deletions

View File

@@ -122,6 +122,17 @@ volumes:
- /pfad/zum/host/uploads:/app/public/uploads
```
---
## 🏥 System Status
Die App stellt einen einfachen Healthcheck-Endpoint bereit, der von Docker oder externen Monitoring-Tools genutzt werden kann:
- **Endpoint**: `/api/health`
- **Method**: `GET`
- **Response**: `200 OK` `{"status":"ok"}`
---
*Erstellt mit ❤️ für alle Dosenöffner.*

5
app/api/health/route.ts Normal file
View File

@@ -0,0 +1,5 @@
import { NextResponse } from 'next/server';
export async function GET() {
return NextResponse.json({ status: 'ok' }, { status: 200 });
}

View File

@@ -9,3 +9,8 @@ services:
- ./data:/app/data
- ./public/uploads:/app/public/uploads
restart: always
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health" ]
interval: 30s
timeout: 10s
retries: 3