diff --git a/Dockerfile b/Dockerfile index 49065a5..de07dfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,6 @@ WORKDIR /app COPY main.py pyproject.toml ./ COPY --from=git /version /app/.version -HEALTHCHECK --start-period=30s CMD python -c "import requests; requests.get('http://localhost:8000', timeout=2)" +HEALTHCHECK --start-period=30s CMD python -c "import requests; requests.get('http://localhost:8000', timeout=2).raise_for_status()" CMD ["uvicorn", "--host=0.0.0.0", "main:app"] diff --git a/main.py b/main.py index 080aba9..78a9e89 100644 --- a/main.py +++ b/main.py @@ -38,6 +38,11 @@ class Passages(BaseModel): stop: Stop +@app.get("/") +async def root(): + return {"status": "ok"} + + @app.get("/stop/{stop_id}", response_model=Passages) async def stop( stop_id: int = Path(