Spaces:
Runtime error
Runtime error
File size: 573 Bytes
008b9c8 7937092 872372c a7ffd76 7937092 872372c 7937092 872372c 008b9c8 872372c 7937092 2d00072 a7ffd76 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Use the official lightweight Python image
FROM python:3.11-slim
# HuggingFace Spaces requires a non-root user for security
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Copy requirements and install
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the entire app with proper user permissions
COPY --chown=user . /app
# Run the FastAPI server on port 7860
CMD ["uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "7860"] |