Server-1730576 / Dockerfile
Simonc-44's picture
Create Dockerfile
5a73b2c verified
Raw
History Blame Contribute Delete
493 Bytes
FROM python:3.10-slim
# évite crash torch CPU
ENV PYTHONUNBUFFERED=1
ENV TRANSFORMERS_CACHE=/cache
ENV HF_HOME=/cache
# dépendances système
RUN apt-get update && apt-get install -y \
git \
gcc \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# install python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# copie code
COPY . .
# port HF Spaces
EXPOSE 7860
# lancement API
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]