Spaces:
Running on Zero
Running on Zero
File size: 705 Bytes
60e9648 | 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 | FROM python:3.11-slim
# Install OS updates & basic system packages
RUN apt-get update -y && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends ffmpeg git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set up user to run the application (Hugging Face Space requirement)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Pre-install dependencies at build time to make startup fast and avoid user permissions issues
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application files
COPY --chown=user . /app
ENV PORT=7860
CMD ["python", "-u", "main.py"]
|