-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cpu
More file actions
50 lines (40 loc) · 1.98 KB
/
Dockerfile.cpu
File metadata and controls
50 lines (40 loc) · 1.98 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
# CoDRAG Headless — CPU Image
# For CI/CD runners (GitHub Actions, GitLab CI) using BYOK cloud LLMs.
# No GPU required. ONNX embeddings run natively on CPU.
#
# Build:
# docker build -f Dockerfile.cpu -t codrag/headless:cpu .
#
# Usage:
# codrag sync-headless \
# --repo-path /workspace \
# --model-provider openai --model-name gpt-4.1-mini \
# --embedder native
FROM ubuntu:22.04 AS base
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3.11-venv python3-pip \
git openssh-client curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
# ── Install CoDRAG ───────────────────────────────────────────
WORKDIR /opt/codrag
# Copy the CoDRAG source and install
# In CI, this is replaced by a pip install from the published package
COPY pyproject.toml .
COPY src/ src/
COPY engine/ engine/
RUN pip install --no-cache-dir ".[headless]"
# ── Pre-download ONNX embedding model ────────────────────────
# nomic-embed-text-v1.5 quantized (~132 MB), cached in /root/.cache/huggingface
RUN python -c "from codrag.core.embedder import NativeEmbedder; NativeEmbedder().download_model()" \
|| echo "WARN: Model pre-download skipped (will download on first run)"
# ── S3 sync dependencies ─────────────────────────────────────
RUN pip install --no-cache-dir boto3 minio
# ── Default entrypoint ────────────────────────────────────────
ENTRYPOINT ["codrag"]
CMD ["sync-headless", "--help"]