luigui300 commited on
Commit
120c80e
·
1 Parent(s): a543540

Fix OpenCV headless for Linux deployment

Browse files
Files changed (2) hide show
  1. Dockerfile +14 -7
  2. requirements.txt +1 -1
Dockerfile CHANGED
@@ -1,17 +1,24 @@
1
  FROM python:3.10.13-slim
2
 
3
  WORKDIR /app
4
- COPY requirements.txt .
5
 
6
- RUN pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \
7
- --index-url https://download.pytorch.org/whl/cpu
 
 
 
 
8
 
9
- RUN pip install torch-scatter torch-sparse torch-cluster \
10
- -f https://data.pyg.org/whl/torch-2.5.1+cpu.html
11
 
12
- RUN pip install torch-geometric==2.7.0
13
- RUN pip install -r requirements.txt
 
 
 
 
14
 
15
  COPY . .
16
 
 
17
  CMD ["python", "app.py"]
 
1
  FROM python:3.10.13-slim
2
 
3
  WORKDIR /app
 
4
 
5
+ RUN apt-get update && apt-get install -y \
6
+ libglib2.0-0 \
7
+ libsm6 \
8
+ libxext6 \
9
+ libxrender-dev \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ COPY requirements.txt .
 
13
 
14
+ RUN pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \
15
+ --index-url https://download.pytorch.org/whl/cpu && \
16
+ pip install torch-scatter torch-sparse torch-cluster \
17
+ -f https://data.pyg.org/whl/torch-2.5.1+cpu.html && \
18
+ pip install torch-geometric==2.7.0 && \
19
+ pip install -r requirements.txt
20
 
21
  COPY . .
22
 
23
+ EXPOSE 7860
24
  CMD ["python", "app.py"]
requirements.txt CHANGED
@@ -11,7 +11,7 @@ mambapy==1.2.0
11
 
12
  # Computer Vision
13
  mediapipe==0.10.21
14
- opencv-python==4.11.0.86
15
 
16
  # Data
17
  numpy==1.26.4
 
11
 
12
  # Computer Vision
13
  mediapipe==0.10.21
14
+ opencv-python-headless==4.11.0.86
15
 
16
  # Data
17
  numpy==1.26.4