Jacky2305 commited on
Commit
3a3dd5f
·
1 Parent(s): 303ff90

fix: install libgl1/libglib2.0-0 for cv2; extra-index-url for cpu torch

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -0
Dockerfile CHANGED
@@ -2,6 +2,11 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
5
  # CPU 版 torch:用 extra-index-url 同時保留 PyPI,否則依賴包解析會炸
6
  RUN pip install --no-cache-dir torch==2.4.1 --extra-index-url https://download.pytorch.org/whl/cpu
7
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # cv2 / insightface 需要的系統庫(slim 鏡像缺這些會 import cv2 炸掉)
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ libgl1 libglib2.0-0 libgomp1 \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
  # CPU 版 torch:用 extra-index-url 同時保留 PyPI,否則依賴包解析會炸
11
  RUN pip install --no-cache-dir torch==2.4.1 --extra-index-url https://download.pytorch.org/whl/cpu
12