-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.embedder.cpu
More file actions
26 lines (23 loc) · 962 Bytes
/
Copy pathDockerfile.embedder.cpu
File metadata and controls
26 lines (23 loc) · 962 Bytes
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
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
HF_HOME=/cache/huggingface \
EMBEDDING_MODEL=Qwen/Qwen3-Embedding-0.6B \
EMBEDDING_DEVICE=cpu \
EMBEDDING_BATCH_SIZE=8 \
EMBEDDING_MAX_LENGTH=512
WORKDIR /app
COPY pyproject.toml README.md ./
COPY justatom ./justatom
RUN python -m pip install --no-cache-dir --upgrade pip \
&& python -m pip install --no-cache-dir \
--index-url https://download.pytorch.org/whl/cpu torch==2.8.0 \
&& python -m pip install --no-cache-dir '.[embedder]' \
&& useradd --create-home --uid 10001 justatom \
&& mkdir -p /cache/huggingface \
&& chown -R 10001:10001 /cache/huggingface
USER 10001:10001
EXPOSE 8000
HEALTHCHECK --interval=10s --timeout=3s --start-period=120s --retries=30 \
CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2)"]
CMD ["python", "-m", "justatom.api.serve_embeddings"]