dhruv2842 commited on
Commit
ca5da9f
·
verified ·
1 Parent(s): 14041ff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -19
Dockerfile CHANGED
@@ -1,19 +1,25 @@
1
- # 1️⃣ Use an official slim Python image
2
- FROM python:3.9-slim
3
-
4
- # 2️⃣ Set working directory
5
- WORKDIR /app
6
-
7
- # 3️⃣ Copy requirements first
8
- COPY requirements.txt .
9
-
10
- RUN pip install --no-cache-dir -r requirements.txt
11
-
12
- # 4️⃣ Copy all files from the root of your project (app.py, .h5, .json, results dir, etc.)
13
- COPY . .
14
-
15
- # 5️⃣ Expose the port
16
- EXPOSE 7860
17
-
18
- # 6️⃣ Command to run the app
19
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
1
+ # 1️⃣ Use an official slim Python image
2
+ FROM python:3.9-slim
3
+
4
+ # 2️⃣ Set working directory
5
+ WORKDIR /app
6
+
7
+ # 3️⃣ Install required system dependencies (fixes libGL error for OpenCV)
8
+ RUN apt-get update && \
9
+ apt-get install -y libgl1-mesa-glx && \
10
+ rm -rf /var/lib/apt/lists/*
11
+
12
+ # 4️⃣ Copy requirements
13
+ COPY requirements.txt .
14
+
15
+ # 5️⃣ Install Python dependencies
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # 6️⃣ Copy all files from the root of your project
19
+ COPY . .
20
+
21
+ # 7️⃣ Expose the port
22
+ EXPOSE 7860
23
+
24
+ # 8️⃣ Command to run the app
25
+ CMD ["python", "app.py"]