Peeble commited on
Commit
2d9a129
·
verified ·
1 Parent(s): 1d200e6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]