Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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️⃣
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
# 4️⃣ Copy
|
13 |
-
COPY . .
|
14 |
-
|
15 |
-
# 5️⃣
|
16 |
-
|
17 |
-
|
18 |
-
# 6️⃣
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|