Spaces:
Running
Running
File size: 1,080 Bytes
c69b4cc ea32365 f117452 3f1d6fd 5a96af5 3f1d6fd c69b4cc f117452 c69b4cc f117452 c69b4cc 5a96af5 f117452 c69b4cc f117452 c69b4cc 5a96af5 f117452 c69b4cc f117452 c69b4cc b76b429 5a96af5 6adce9c |
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 30 31 32 |
# Use an official Python runtime as a parent image
FROM python:3.9.13
# Install system dependencies (including FFmpeg)
RUN apt-get update && apt-get install -y ffmpeg && \
rm -rf /var/lib/apt/lists/* # Clean up to reduce image size
# Create a new user with a specific UID and home directory
RUN useradd -m -u 1000 user
# Set the user for subsequent instructions
USER user
# Update the PATH environment variable
ENV PATH="/home/user/.local/bin:${PATH}"
# Set the working directory
WORKDIR /app
# Copy the requirements file into the container
COPY --chown=user ./requirements.txt /app/requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt && \
pip install --no-cache-dir --user gunicorn # Install Gunicorn
# Copy the current directory contents into the container at /app
COPY --chown=user . /app
# Command to run the application using Gunicorn
# Set a higher timeout (e.g., 300 seconds) to handle long-running tasks
ENTRYPOINT ["gunicorn", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "3000", "app:app"] |