chore: update Docker configuration and improve health check functionality
All checks were successful
CI / lint-and-test (push) Successful in 22s
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:
@@ -35,6 +35,14 @@ def _is_valid_calendar_token(token: str) -> bool:
|
||||
|
||||
|
||||
app = FastAPI(title="Duty Teller API")
|
||||
|
||||
|
||||
@app.get("/health", summary="Health check")
|
||||
def health() -> dict:
|
||||
"""Return 200 when the app is up. Used by Docker HEALTHCHECK."""
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=config.CORS_ORIGINS,
|
||||
|
||||
Reference in New Issue
Block a user