amitkumar299 commited on
Commit
58acee7
·
verified ·
1 Parent(s): 23f5787

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -19
Dockerfile CHANGED
@@ -1,30 +1,15 @@
1
- # Use a slim Python base image
2
- FROM python:3.9-slim
3
 
4
- # Install system dependencies for OpenCV
5
  RUN apt-get update && apt-get install -y \
6
- libgl1-mesa-glx \
7
- libglib2.0-0 \
8
- ffmpeg \
9
- libsm6 \
10
- libxext6 \
11
- git
12
 
13
- # Set the working directory
14
  WORKDIR /app
15
 
16
- # Copy the requirements file and install dependencies
17
  COPY requirements.txt .
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Copy your application code
21
  COPY . .
22
 
23
- # Download the YOLOv8 model (alternatively, ensure it's copied with your app)
24
- RUN python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"
25
-
26
- # Expose the port Hugging Face Spaces expects
27
  EXPOSE 7860
28
-
29
- # Command to run your Flask app with Gunicorn
30
- CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
 
1
+ FROM python:3.10-slim
 
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
+ ffmpeg libsm6 libxext6 libglib2.0-0 \
5
+ && apt-get clean
 
 
 
 
6
 
 
7
  WORKDIR /app
8
 
 
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
12
  COPY . .
13
 
 
 
 
 
14
  EXPOSE 7860
15
+ CMD ["python", "app.py"]