File size: 753 Bytes
5817aa9 b0103ac 9e04154 cd61834 37ba3e0 9e04154 37ba3e0 5817aa9 9e04154 | 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 | # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.10-slim
# Install system dependencies BEFORE switching to user
RUN apt-get update && apt-get install -y \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Install build tools as root
RUN pip install --no-cache-dir --upgrade pip setuptools wheel setuptools-scm
# Copy and install requirements BEFORE switching user
COPY ./requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user . /app
# Flask app runs on port 7860 for HF Spaces
CMD ["python", "app.py"] |