z2learn commited on
Commit
f6fe243
Β·
verified Β·
1 Parent(s): ceca54f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -------------- Dockerfile --------------
2
+
3
+ # Use a lightweight Python base image
4
+ FROM python:3.10-slim
5
+
6
+ # Set a working directory inside the container
7
+ WORKDIR /app
8
+
9
+ # Copy only requirements first (to leverage Docker cache)
10
+ COPY requirements.txt .
11
+
12
+ # Upgrade pip and install Python dependencies
13
+ RUN pip install --upgrade pip && \
14
+ pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy the application code into the container
17
+ COPY app.py .
18
+
19
+ # Expose the port that Gradio will listen on
20
+ EXPOSE 7860
21
+
22
+ # Set environment variables so Gradio binds to 0.0.0.0 (all interfaces)
23
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
24
+ ENV GRADIO_SERVER_PORT="7860"
25
+
26
+ # Start the Gradio app
27
+ CMD ["python", "app.py"]
28
+
29
+ # -------------- End of Dockerfile --------------