-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (33 loc) · 1.41 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (33 loc) · 1.41 KB
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
36
37
38
39
40
# Two stages: the UI builds under node and ships as static files; the API image never
# contains node. The final image runs as a non-root user because a public agent endpoint
# is exactly the kind of process that should not be able to write outside /tmp.
FROM node:22-slim AS ui
WORKDIR /build
COPY ui/package.json ui/package-lock.json ./
RUN npm ci
COPY ui/ ./
RUN npm run build
FROM python:3.12-slim AS app
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /srv
# Dependencies first, so a code change does not re-resolve the environment.
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project
# The application, plus what it serves at runtime: recorded demo fixtures, the committed
# benchmark results behind /metrics, and the prompt templates the graph renders.
COPY app/ app/
COPY agent/ agent/
COPY providers/ providers/
COPY retrieval/ retrieval/
COPY verify/ verify/
COPY bench/ bench/
COPY demo/ demo/
COPY --from=ui /build/dist ui/dist
RUN useradd --system --no-create-home attest
USER attest
ENV PATH="/srv/.venv/bin:$PATH" ENVIRONMENT=production
EXPOSE 8000
# --limit-concurrency bounds open connections at the socket, one layer below the run
# semaphore: the semaphore protects the wallet, this protects the event loop from a
# thousand idle SSE connections that never start a run.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--limit-concurrency", "32"]