forked from antoinezambelli/forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (35 loc) · 1.47 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (35 loc) · 1.47 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
41
42
43
44
45
46
47
48
49
50
51
FROM python:3.13-alpine3.23 AS builder
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip \
&& pip install --root-user-action=ignore --no-cache-dir uv
ENV UV_LINK_MODE=copy
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --extra anthropic --no-install-project --no-dev
COPY pyproject.toml LICENSE README.md ./
COPY src/ ./src/
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --extra anthropic --no-dev
FROM python:3.13-alpine3.23
LABEL org.opencontainers.image.title="Forge Proxy" \
org.opencontainers.image.description="A reliability layer for self-hosted LLM tool-calling" \
org.opencontainers.image.url="https://github.com/antoinezambelli/forge" \
org.opencontainers.image.source="https://github.com/antoinezambelli/forge" \
org.opencontainers.image.vendor="Antoine Zambelli" \
org.opencontainers.image.licenses="MIT"
ENV PYTHONUNBUFFERED=1
RUN apk add --no-cache ca-certificates \
&& addgroup -g 1000 appuser \
&& adduser -D -u 1000 -G appuser appuser
COPY --from=builder --chown=appuser:appuser /app /app
WORKDIR /app
USER appuser
ENV PATH="/app/.venv/bin:$PATH"
HEALTHCHECK \
--interval=15s \
--timeout=5s \
--start-period=5s \
--retries=3 \
CMD ["wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8081/health"]
EXPOSE 8081
ENTRYPOINT ["forge-proxy", "--host", "0.0.0.0", "--port", "8081"]