vinay0123 commited on
Commit
c371e2d
·
verified ·
1 Parent(s): f18f5be

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -25
Dockerfile CHANGED
@@ -1,25 +1,29 @@
1
- # Base image
2
- FROM python:3.9-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Copy requirement files
8
- COPY requirements.txt .
9
-
10
- # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Copy the rest of the code
14
- COPY . .
15
-
16
- # Expose port (Spaces expects 7860 or 5000)
17
- EXPOSE 7860
18
-
19
- # Set environment variable for Flask
20
- ENV FLASK_APP=app.py
21
- ENV FLASK_RUN_PORT=7860
22
- ENV FLASK_RUN_HOST=0.0.0.0
23
-
24
- # Run the Flask app
25
- CMD ["flask", "run"]
 
 
 
 
 
1
+ # Base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies for OpenCV
8
+ RUN apt-get update && apt-get install -y libgl1 && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirement files
11
+ COPY requirements.txt .
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy the rest of the code
17
+ COPY . .
18
+
19
+ # Expose port (Spaces expects 7860 or 5000)
20
+ EXPOSE 7860
21
+
22
+ # Set environment variables for Flask
23
+ ENV FLASK_APP=app.py
24
+ ENV FLASK_RUN_PORT=7860
25
+ ENV FLASK_RUN_HOST=0.0.0.0
26
+
27
+ # Run the Flask app
28
+ CMD ["flask", "run"]
29
+