-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 1.33 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
FROM python:3.11-slim
WORKDIR /app
# Install uv for fast dependency resolution
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Install nadirclaw from PyPI + dependencies (cached between builds)
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system "nadirclaw[dashboard]>=0.13" boto3>=1.35
# Pre-download the sentence-transformers model (cached between builds)
RUN --mount=type=cache,target=/root/.cache/huggingface \
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" \
&& cp -r /root/.cache/huggingface/hub/models--sentence-transformers--all-MiniLM-L6-v2 \
/root/.cache/torch/ 2>/dev/null || true
# Apply patches: streaming usage, content limit, context overflow routing
COPY config/patch-streaming-usage.py config/patch-context-overflow.py /tmp/
RUN python /tmp/patch-streaming-usage.py \
&& python /tmp/patch-context-overflow.py \
&& rm /tmp/patch-streaming-usage.py /tmp/patch-context-overflow.py
# Place config where nadirclaw expects it (skips the interactive setup wizard)
RUN mkdir -p /root/.nadirclaw
COPY config/nadirclaw.env /root/.nadirclaw/.env
EXPOSE 4000
# Bind to 0.0.0.0 inside the container is fine — docker-compose
# restricts the host-side mapping to 127.0.0.1 only.
ENTRYPOINT ["nadirclaw", "serve", "--port", "4000"]