shiue2000 commited on
Commit
bf221ac
·
verified ·
1 Parent(s): 750f185

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as the base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Set environment variables
8
+ ENV PYTHONUNBUFFERED=1
9
+ ENV PYTHONDONTWRITEBYTECODE=1
10
+
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y \
13
+ build-essential \
14
+ libatlas-base-dev \
15
+ gfortran \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy requirements file
19
+ COPY requirements.txt .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --upgrade pip
23
+ RUN pip install -r requirements.txt
24
+
25
+ # Copy the application code
26
+ COPY . .
27
+
28
+ # Expose the port Gradio uses (default is 7860)
29
+ EXPOSE 7860
30
+
31
+ # Run the application
32
+ CMD ["python", "app.py"]