emotion-classifier / Dockerfile
AfroLogicInsect's picture
initial migration from Render: FastAPI + Gradio, port 7860
811fc57
Raw
History Blame Contribute Delete
447 Bytes
FROM python:3.11-slim
WORKDIR /app
# Create non-root user (required by HF Spaces)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY --chown=user . .
# HuggingFace Spaces requires port 7860
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]