chore: update Docker configuration and improve health check functionality
All checks were successful
CI / lint-and-test (push) Successful in 22s

- Added Docker health check endpoint to the FastAPI application, returning a 200 status when the app is running.
- Updated Dockerfile to include curl for health checks and modified entrypoint script to exit on errors.
- Enhanced .dockerignore and .gitignore files to exclude coverage and test artifacts.
- Updated docker-compose.prod.yml to specify version.
- Added pytest-cov as a development dependency to improve test coverage reporting.
This commit is contained in:
2026-02-20 20:31:43 +03:00
parent aa89494bd5
commit f53ef81306
9 changed files with 34 additions and 6 deletions

View File

@@ -16,6 +16,13 @@ def client():
return TestClient(app)
def test_health(client):
"""Health endpoint returns 200 and status ok for Docker HEALTHCHECK."""
r = client.get("/health")
assert r.status_code == 200
assert r.json() == {"status": "ok"}
def test_duties_invalid_date_format(client):
r = client.get("/api/duties", params={"from": "2025-01-01", "to": "invalid"})
assert r.status_code == 400