-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 947 Bytes
/
Dockerfile
File metadata and controls
35 lines (23 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Stage 1: build with uv
FROM python:3.14-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
COPY . .
# Stage 2: runtime
FROM python:3.14-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
RUN groupadd -r codeward && useradd -r -g codeward codeward
WORKDIR /app
COPY --from=builder /app /app
# Create data directory for SQLite and set ownership
RUN mkdir -p /app/data /app/.cache/uv \
&& chown -R codeward:codeward /app/data /app/.cache/uv /app/.venv
ENV UV_CACHE_DIR=/app/.cache/uv \
UV_LINK_MODE=copy
EXPOSE 8420
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8420/health')"]
USER codeward
CMD ["uv", "run", "uvicorn", "codeward.main:app", "--factory", "--host", "0.0.0.0", "--port", "8420"]