File size: 1,480 Bytes
e462db8
4cccbf3
e462db8
c6483ba
e462db8
 
c6483ba
 
 
 
 
 
4cccbf3
17e31af
 
 
 
 
 
 
 
 
c6483ba
 
 
 
e462db8
c6483ba
 
4cccbf3
c6483ba
 
e462db8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04

RUN apt-get update && apt-get install -y \
    git cmake build-essential python3 python3-pip python3-dev \
    libboost-all-dev libopenblas-dev liblapack-dev

WORKDIR /dlib
RUN git clone https://github.com/davisking/dlib.git . \
  && mkdir build && cd build \
  && cmake .. -DDLIB_USE_CUDA=1 \
  && cmake --build . --config Release


# Choose a writable directory, e.g., /home/user/huggingface
RUN mkdir -p /home/user/huggingface
RUN chmod -R 777 /home/user/huggingface

# Then set environment variables
ENV HF_HOME=/home/user/huggingface \
    HF_HUB_CACHE=/home/user/huggingface/hub \
    TRANSFORMERS_CACHE=/home/user/huggingface/hub

# install via pip so dependencies like wheel are used
RUN pip install --upgrade pip wheel cmake setuptools && \
    cd /dlib && python3 setup.py install

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python3", "app.py"]


# FROM yogi0421/dlib-base-image:python38-dlib19.24.0

# WORKDIR /app

# # Choose a writable directory, e.g., /home/user/huggingface
# RUN mkdir -p /home/user/huggingface
# RUN chmod -R 777 /home/user/huggingface

# # Then set environment variables
# ENV HF_HOME=/home/user/huggingface \
#     HF_HUB_CACHE=/home/user/huggingface/hub \
#     TRANSFORMERS_CACHE=/home/user/huggingface/hub

# COPY requirements.txt .
# RUN pip install --upgrade pip \
#     && pip install -r requirements.txt

# COPY . .
# CMD ["python", "app.py"]