ctranslate / Dockerfile
anatoli72's picture
Update Dockerfile
1410812 verified
raw
history blame contribute delete
596 Bytes
FROM python:3.11-slim
WORKDIR /app
ENV TRANSFORMERS_CACHE=/tmp/cache
ENV HF_HOME=/tmp/hf_home
# Сначала PyTorch (CPU версия — легче)
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
# Затем остальные зависимости
RUN pip install --no-cache-dir \
ctranslate2>=3.13.0 \
hf-hub-ctranslate2 \
transformers>=4.35.0 \
sentencepiece>=0.1.99 \
fastapi>=0.111.0 \
uvicorn>=0.30.0 \
pydantic>=2.0.0
COPY app.py .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]