File size: 914 Bytes
ca09bc5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.10-slim

# System dependencies (FFmpeg is required for yt_dlp postprocessing)
RUN apt-get update \
 && apt-get install -y --no-install-recommends ffmpeg curl ca-certificates \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python deps first (better layer caching)
COPY requirements.txt ./
# Keep image lean and avoid version-check noise
ENV PIP_NO_CACHE_DIR=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

# Upgrade pip to avoid resolver quirks on slim images
RUN python -m pip install --upgrade pip \
 && pip install -r requirements.txt

# Copy application code
COPY app.py ./

# Default envs for Gradio; actual port may be injected by the platform as $PORT
ENV GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=7860 \
    PORT=7860

# Expose default (platform may override via $PORT)
EXPOSE 7860

# Run the app
CMD ["python", "app.py"]