Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +24 -10
Dockerfile
CHANGED
|
@@ -1,20 +1,34 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
ffmpeg \
|
| 5 |
-
|
| 6 |
libmagic1 \
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
WORKDIR /home/user/app
|
| 12 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 20 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies: ffmpeg for processing, wget for downloads,
|
| 5 |
+
# libmagic for file type detection, and fonts for text overlays.
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
ffmpeg \
|
| 8 |
+
wget \
|
| 9 |
libmagic1 \
|
| 10 |
+
fonts-dejavu-core \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Set the working directory
|
| 14 |
+
WORKDIR /app
|
| 15 |
|
| 16 |
+
# Create a temp directory and set permissions for the Hugging Face user (ID 1000)
|
| 17 |
+
RUN mkdir -p /app/temp && chmod 777 /app/temp
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Copy requirements and install
|
| 20 |
+
COPY requirements.txt .
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
+
# Copy the application code
|
| 24 |
+
COPY . .
|
| 25 |
+
|
| 26 |
+
# Set environment variables
|
| 27 |
+
ENV PYTHONUNBUFFERED=1
|
| 28 |
+
ENV TEMP_DIR=/app/temp
|
| 29 |
+
|
| 30 |
+
# Expose the port Gradio/FastAPI will run on
|
| 31 |
+
EXPOSE 7860
|
| 32 |
|
| 33 |
+
# Run the application
|
| 34 |
CMD ["python", "app.py"]
|