3v324v23 commited on
Commit
31db4cf
·
1 Parent(s): d719c93

update docker file

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -1
Dockerfile CHANGED
@@ -2,8 +2,17 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
5
  RUN pip install --upgrade pip
6
 
 
7
  RUN pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu
8
 
9
  COPY requirements.txt .
@@ -12,4 +21,5 @@ RUN pip install --no-cache-dir -r requirements.txt
12
  COPY app ./app
13
 
14
  EXPOSE 7860
15
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Cài system libs cần cho OpenCV headless + torch
6
+ RUN apt-get update && apt-get install -y \
7
+ libglib2.0-0 \
8
+ libsm6 \
9
+ libxrender1 \
10
+ libxext6 \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
  RUN pip install --upgrade pip
14
 
15
+ # Torch CPU
16
  RUN pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu
17
 
18
  COPY requirements.txt .
 
21
  COPY app ./app
22
 
23
  EXPOSE 7860
24
+
25
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]