Peeble commited on
Commit
288e32e
·
verified ·
1 Parent(s): 3eb1c82

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -6
Dockerfile CHANGED
@@ -1,21 +1,44 @@
 
1
  FROM python:3.11-slim
2
 
3
- # Install system deps + create non-root user
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- ffmpeg libgl1-mesa-glx && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
6
 
 
7
  WORKDIR /app
8
 
9
- # Copy only requirements first (cache-friendly)
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 app code AFTER deps (this layer won't invalidate pip)
15
  COPY . .
16
 
17
- # Gradio setup
18
- RUN mkdir -p /home/user/app && ln -s /app /home/user/app
 
 
 
 
 
 
 
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"]