DARKWICK commited on
Commit
ca09bc5
·
verified ·
1 Parent(s): 7d0739b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -26
Dockerfile CHANGED
@@ -1,26 +1,34 @@
1
- FROM python:3.10-slim
2
-
3
- # System dependencies (FFmpeg is required for audio processing via yt_dlp)
4
- RUN apt-get update \
5
- && apt-get install -y --no-install-recommends ffmpeg curl \
6
- && rm -rf /var/lib/apt/lists/*
7
-
8
- WORKDIR /app
9
-
10
- # Copy and install dependencies
11
- COPY requirements.txt ./
12
- RUN pip install --no-cache-dir -r requirements.txt
13
-
14
- # Copy the application code
15
- COPY app.py ./
16
-
17
- # Environment variables for Gradio
18
- ENV GRADIO_SERVER_NAME=0.0.0.0 \
19
- GRADIO_SERVER_PORT=7860 \
20
- PYTHONUNBUFFERED=1
21
-
22
- # Expose the default Gradio port
23
- EXPOSE 7860
24
-
25
- # Start the app
26
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # System dependencies (FFmpeg is required for yt_dlp postprocessing)
4
+ RUN apt-get update \
5
+ && apt-get install -y --no-install-recommends ffmpeg curl ca-certificates \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ WORKDIR /app
9
+
10
+ # Install Python deps first (better layer caching)
11
+ COPY requirements.txt ./
12
+ # Keep image lean and avoid version-check noise
13
+ ENV PIP_NO_CACHE_DIR=1 \
14
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
15
+ PYTHONDONTWRITEBYTECODE=1 \
16
+ PYTHONUNBUFFERED=1
17
+
18
+ # Upgrade pip to avoid resolver quirks on slim images
19
+ RUN python -m pip install --upgrade pip \
20
+ && pip install -r requirements.txt
21
+
22
+ # Copy application code
23
+ COPY app.py ./
24
+
25
+ # Default envs for Gradio; actual port may be injected by the platform as $PORT
26
+ ENV GRADIO_SERVER_NAME=0.0.0.0 \
27
+ GRADIO_SERVER_PORT=7860 \
28
+ PORT=7860
29
+
30
+ # Expose default (platform may override via $PORT)
31
+ EXPOSE 7860
32
+
33
+ # Run the app
34
+ CMD ["python", "app.py"]