-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (53 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
65 lines (53 loc) · 1.54 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM golang:1.25-bookworm AS builder
WORKDIR /build
# Cache dependency downloads
COPY go.mod go.sum ./
RUN go mod download
# Build
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o /sieve ./cmd/sieve
# Runtime image with batteries-included Python for policy scripts
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install uv (fast Python package manager) and set up Python environment
# with common packages useful for policy scripts.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV UV_PYTHON_PREFERENCE=managed
RUN uv python install 3.12 && \
uv venv /opt/sieve-py && \
. /opt/sieve-py/bin/activate && \
uv pip install \
# HTTP / API
requests httpx \
# Data
pandas numpy \
# LLM clients (for script-based policies that call LLMs)
openai anthropic google-generativeai \
# Parsing / formats
beautifulsoup4 lxml pyyaml \
# Auth / crypto
pyjwt cryptography \
# Text / regex
regex \
# JSON schema
pydantic \
# Templating
jinja2 \
# Token counting
tiktoken
ENV PATH="/opt/sieve-py/bin:$PATH"
# Non-root user
RUN useradd -r -s /bin/false sieve && \
mkdir -p /data /policies && \
chown sieve:sieve /data /policies
COPY --from=builder /sieve /usr/local/bin/sieve
USER sieve
VOLUME ["/data"]
VOLUME ["/policies"]
EXPOSE 19816 19817
ENTRYPOINT ["sieve"]
CMD ["serve"]