forked from jina-ai/MMTEB-MCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 1.13 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
FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv venv .venv && uv sync --frozen --no-dev --no-cache
COPY src/ src/
COPY scripts/ scripts/
# Download data and pre-build DataStore pickle at build time
RUN mkdir -p /tmp/mteb_cache && \
curl -L -o /tmp/mteb_cache/__cached_results.json.gz \
"https://raw.githubusercontent.com/embeddings-benchmark/results/cached-data/__cached_results.json.gz" && \
python -c "import gzip,pathlib; d=gzip.decompress(pathlib.Path('/tmp/mteb_cache/__cached_results.json.gz').read_bytes()); pathlib.Path('/tmp/mteb_cache/__cached_results.json').write_bytes(d)" && \
rm /tmp/mteb_cache/__cached_results.json.gz && \
.venv/bin/python scripts/fetch_model_sizes.py && \
.venv/bin/python scripts/prebuild_data.py && \
rm /tmp/mteb_cache/__cached_results.json
EXPOSE 8080
ENV PYTHONUNBUFFERED=1
CMD [".venv/bin/python", "-m", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080", "--timeout-keep-alive", "120"]