Update Dockerfile
Browse files- Dockerfile +29 -6
Dockerfile
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# Install system
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
-
ffmpeg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
# Copy
|
| 10 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 11 |
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 12 |
pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
-
# Copy
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
-
# Gradio
|
| 18 |
-
RUN mkdir -p /home/user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
EXPOSE 7860
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Dockerfile for Veo 3 Gradio app on Hugging Face Spaces
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies for video/audio processing
|
| 5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
ffmpeg \
|
| 7 |
+
libgl1-mesa-glx \
|
| 8 |
+
libglib2.0-0 \
|
| 9 |
+
libsm6 \
|
| 10 |
+
libxext6 \
|
| 11 |
+
libxrender-dev \
|
| 12 |
+
libgomp1 \
|
| 13 |
+
wget \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Set working directory
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
+
# Copy requirements first for better Docker layer caching
|
| 20 |
COPY requirements.txt .
|
| 21 |
+
|
| 22 |
+
# Install Python dependencies with cache mount
|
| 23 |
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 24 |
pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
+
# Copy application code
|
| 27 |
COPY . .
|
| 28 |
|
| 29 |
+
# Create symlinks for Gradio/Spaces compatibility
|
| 30 |
+
RUN mkdir -p /home/user && \
|
| 31 |
+
ln -sf /app /home/user/app || true
|
| 32 |
+
|
| 33 |
+
# Switch to non-root user for security
|
| 34 |
+
RUN useradd -m -u 1000 user && chown -R user:user /app
|
| 35 |
+
USER user
|
| 36 |
+
|
| 37 |
+
# Expose Gradio port
|
| 38 |
EXPOSE 7860
|
| 39 |
|
| 40 |
+
# Health check
|
| 41 |
+
HEALTHCHECK CMD curl --fail http://localhost:7860 || exit 1
|
| 42 |
+
|
| 43 |
+
# Run the application
|
| 44 |
CMD ["python", "app.py"]
|