Health-Check: Dedizierter Endpunkt /health implementiert

- Neue Route /health für Container-Monitoring
- Wird NICHT geloggt oder statistisch ausgewertet
- Schnelle JSON-Antwort mit Status und Zeitstempel
- Docker Health-Check nutzt jetzt /health statt /
- Optimiert für Container-Health-Monitoring
This commit is contained in:
2025-08-23 11:33:46 +02:00
parent 61d01e1e11
commit f5b9532c86
2 changed files with 6 additions and 1 deletions

5
app.py
View File

@@ -291,6 +291,11 @@ def screenshot_image():
return send_from_directory(Path(__file__).parent, 'screenshot.png', mimetype='image/png') return send_from_directory(Path(__file__).parent, 'screenshot.png', mimetype='image/png')
@app.route('/health')
def health_check():
"""Health-Check für Docker/Container-Monitoring - wird NICHT geloggt"""
return {'status': 'healthy', 'timestamp': datetime.now().isoformat()}
@app.route('/login', methods=['GET', 'POST']) @app.route('/login', methods=['GET', 'POST'])
def login(): def login():

View File

@@ -18,7 +18,7 @@ services:
user: "1000:1000" user: "1000:1000"
# Healthcheck für Container-Status # Healthcheck für Container-Status
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/"] test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3