30 lines
873 B
Docker
30 lines
873 B
Docker
FROM python:3.11-slim
|
|
|
|
ENV TRANSFORMERS_CACHE=/srv/.hf_cache \
|
|
HF_HUB_DISABLE_TELEMETRY=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
# Minimal nötige Systemlibs für numpy/scipy/sklearn/torch
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libgomp1 libstdc++6 libgfortran5 ca-certificates wget && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /srv
|
|
|
|
# CPU-Torch fest (kein CUDA, kleine Wheels)
|
|
RUN python -m pip install --upgrade pip && \
|
|
pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu "torch==2.2.2"
|
|
|
|
# Satztransformer + Uvicorn/FastAPI
|
|
RUN pip install --no-cache-dir \
|
|
fastapi==0.111.0 \
|
|
uvicorn[standard]==0.30.1 \
|
|
sentence-transformers==3.0.1
|
|
|
|
# App rein
|
|
COPY ../app/embed_server.py /srv/embed_server.py
|
|
|
|
EXPOSE 8990
|
|
CMD ["uvicorn", "embed_server:app", "--host", "0.0.0.0", "--port", "8990"]
|