Add Dockerfile and health endpoints

This commit is contained in:
Michael Pilosov 2026-04-06 15:54:20 -06:00
parent 185a08fa8b
commit abfd7fedc8
3 changed files with 30 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
.venv
.git
__pycache__
*.pyc

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
WORKDIR /app
COPY pyproject.toml uv.lock README.md ./
COPY src/ src/
RUN uv sync --no-dev --locked --no-editable
FROM python:3.13-slim-bookworm
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8888
CMD ["chess-pressure"]

View File

@ -31,6 +31,17 @@ class MoveRequest(BaseModel):
uci: str
# --- Health ---
@app.get("/health", include_in_schema=False)
@app.get("/up", include_in_schema=False)
@app.get("/status", include_in_schema=False)
@app.get("/health-check", include_in_schema=False)
def health():
return {"status": "ok"}
# --- API ---