Sushan commited on
Commit
423f2bb
1 Parent(s): b38308d

updated docker

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -1,6 +1,12 @@
1
  # Base image
2
  FROM python:3.10-slim
3
 
 
 
 
 
 
 
4
  # Set working directory
5
  WORKDIR /app
6
 
@@ -9,13 +15,12 @@ COPY app.py /app/app.py
9
  COPY best_yolov8m_model.pt /app/best_yolov8m_model.pt
10
  COPY requirements.txt /app/requirements.txt
11
 
12
- # Install required packages and check uvicorn installation
13
  RUN pip install --no-cache-dir --upgrade pip && \
14
- pip install --no-cache-dir -r requirements.txt && \
15
- uvicorn --version
16
 
17
  # Expose the port for the API
18
  EXPOSE 8000
19
 
20
- # Alternative CMD via Python
21
  CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
  # Base image
2
  FROM python:3.10-slim
3
 
4
+ # Install necessary system libraries
5
+ RUN apt-get update && apt-get install -y \
6
+ libgl1-mesa-glx \
7
+ libglib2.0-0 \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
  # Set working directory
11
  WORKDIR /app
12
 
 
15
  COPY best_yolov8m_model.pt /app/best_yolov8m_model.pt
16
  COPY requirements.txt /app/requirements.txt
17
 
18
+ # Install required Python packages
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir -r requirements.txt
 
21
 
22
  # Expose the port for the API
23
  EXPOSE 8000
24
 
25
+ # Run FastAPI using Uvicorn
26
  CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]