Spaces:
Sleeping
Sleeping
File size: 660 Bytes
782bbd9 2f0ac35 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
FROM python:3.11
# Create non-root user
RUN useradd -m -u 1000 user
USER user
# Set environment variables
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /app
# Copy requirements first for better caching
COPY --chown=user ./requirements.txt requirements.txt
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application code
COPY --chown=user . /app
# Expose port 7860 (required by Hugging Face Spaces)
EXPOSE 7860
# Run the application
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|