docker-hf / Dockerfile
rbc33's picture
Upload folder using huggingface_hub
2da32e3 verified
raw
history blame contribute delete
429 Bytes
FROM python:3.10-slim
WORKDIR /app
# Crear usuario no-root por seguridad (recomendado en HF Spaces)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . .
# Hugging Face Spaces espera el puerto 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]