feat: add healthcheck endpoint
This commit is contained in:
11
README.md
11
README.md
@@ -122,6 +122,17 @@ volumes:
|
|||||||
- /pfad/zum/host/uploads:/app/public/uploads
|
- /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.*
|
*Erstellt mit ❤️ für alle Dosenöffner.*
|
||||||
|
|||||||
5
app/api/health/route.ts
Normal file
5
app/api/health/route.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
|
export async function GET() {
|
||||||
|
return NextResponse.json({ status: 'ok' }, { status: 200 });
|
||||||
|
}
|
||||||
@@ -9,3 +9,8 @@ services:
|
|||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
- ./public/uploads:/app/public/uploads
|
- ./public/uploads:/app/public/uploads
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health" ]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user