orpatashnik commited on
Commit
c6483ba
·
1 Parent(s): e462db8
Files changed (1) hide show
  1. Dockerfile +15 -10
Dockerfile CHANGED
@@ -1,15 +1,15 @@
1
  FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
2
 
3
  RUN apt-get update && apt-get install -y \
4
- python3 python3-pip python3-dev cmake build-essential \
5
  libboost-all-dev libopenblas-dev liblapack-dev
6
 
7
- RUN git clone https://github.com/davisking/dlib.git /dlib \
8
- && cd /dlib \
9
- && mkdir build && cd build \
10
- && cmake .. -DDLIB_USE_CUDA=1 \
11
- && cmake --build . --config Release \
12
- && python3 setup.py install
13
 
14
  # Choose a writable directory, e.g., /home/user/huggingface
15
  RUN mkdir -p /home/user/huggingface
@@ -20,11 +20,16 @@ ENV HF_HOME=/home/user/huggingface \
20
  HF_HUB_CACHE=/home/user/huggingface/hub \
21
  TRANSFORMERS_CACHE=/home/user/huggingface/hub
22
 
 
 
 
 
23
  WORKDIR /app
24
- COPY requirements.txt ./
25
- RUN pip install --upgrade pip && pip install -r requirements.txt
26
  COPY . .
27
- CMD ["python", "app.py"]
 
28
 
29
  # FROM yogi0421/dlib-base-image:python38-dlib19.24.0
30
 
 
1
  FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
2
 
3
  RUN apt-get update && apt-get install -y \
4
+ git cmake build-essential python3 python3-pip python3-dev \
5
  libboost-all-dev libopenblas-dev liblapack-dev
6
 
7
+ WORKDIR /dlib
8
+ RUN git clone https://github.com/davisking/dlib.git . \
9
+ && mkdir build && cd build \
10
+ && cmake .. -DDLIB_USE_CUDA=1 \
11
+ && cmake --build . --config Release
12
+
13
 
14
  # Choose a writable directory, e.g., /home/user/huggingface
15
  RUN mkdir -p /home/user/huggingface
 
20
  HF_HUB_CACHE=/home/user/huggingface/hub \
21
  TRANSFORMERS_CACHE=/home/user/huggingface/hub
22
 
23
+ # install via pip so dependencies like wheel are used
24
+ RUN pip install --upgrade pip wheel cmake setuptools && \
25
+ cd /dlib && python3 setup.py install
26
+
27
  WORKDIR /app
28
+ COPY requirements.txt .
29
+ RUN pip install -r requirements.txt
30
  COPY . .
31
+ CMD ["python3", "app.py"]
32
+
33
 
34
  # FROM yogi0421/dlib-base-image:python38-dlib19.24.0
35