Skip to content

Commit

Permalink
add admin healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
amalshaji committed Mar 26, 2024
1 parent edb7611 commit 0b2b488
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ FROM python:3.12-slim as final
ENV PATH="/app/.venv/bin:$PATH" \
PYTHONPATH="/app/src:$PYTHONPATH"

RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=builder /app/.venv/ /app/.venv/
Expand Down
5 changes: 5 additions & 0 deletions admin/src/portr_admin/apis/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
api.include_router(api_v1_connection)
api.include_router(api_v1_instance_settings)
api.include_router(api_v1_config)


@api.get("/healthcheck", tags=["healthcheck"])
async def healthcheck():
return {"status": "ok"}
5 changes: 5 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ services:
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/healthcheck"]
interval: 10s
timeout: 5s
retries: 5
labels:
caddy_0: $PORTR_DOMAIN
caddy_0.reverse_proxy: "{{upstreams http 8000}}"
Expand Down

0 comments on commit 0b2b488

Please sign in to comment.