File size: 737 Bytes
f6fe243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# -------------- Dockerfile --------------

# Use a lightweight Python base image
FROM python:3.10-slim

# Set a working directory inside the container
WORKDIR /app

# Copy only requirements first (to leverage Docker cache)
COPY requirements.txt .

# Upgrade pip and install Python dependencies
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy the application code into the container
COPY app.py .

# Expose the port that Gradio will listen on
EXPOSE 7860

# Set environment variables so Gradio binds to 0.0.0.0 (all interfaces)
ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV GRADIO_SERVER_PORT="7860"

# Start the Gradio app
CMD ["python", "app.py"]

# -------------- End of Dockerfile --------------