Add Dockerfile and health endpoints
This commit is contained in:
parent
185a08fa8b
commit
abfd7fedc8
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
.venv
|
||||
.git
|
||||
__pycache__
|
||||
*.pyc
|
||||
15
Dockerfile
Normal file
15
Dockerfile
Normal 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"]
|
||||
@ -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 ---
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user