-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
60 lines (51 loc) · 1.48 KB
/
Dockerfile
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
54
55
56
57
58
59
60
FROM ubuntu:18.04
RUN apt update && apt install -y gcc unzip curl
# Dependencies for opencv
RUN apt install -y \
gfortran \
graphicsmagick \
libgraphicsmagick1-dev \
libavcodec-dev \
libavformat-dev \
libboost-all-dev \
libjpeg-dev \
libswscale-dev \
pkg-config \
python-protobuf \
python3-protobuf \
software-properties-common
# Needed dependencies for dlib
RUN apt install -y build-essential cmake
RUN apt install -y libopenblas-dev liblapack-dev
RUN apt install -y libx11-dev libgtk-3-dev
RUN apt install -y python python-dev python-pip
RUN apt install -y python3 python3-dev python3-pip
# Set the working directory for containers
WORKDIR .
# Installing python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# Installing opencv
RUN cd ~ && \
mkdir -p ocv-tmp && \
cd ocv-tmp && \
curl -L https://github.com/opencv/opencv/archive/4.2.0.zip -o ocv.zip && \
unzip ocv.zip && \
cd opencv-4.2.0 && \
mkdir release && \
cd release && \
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_PYTHON_SUPPORT=ON \
.. && \
make -j8 && \
make install && \
rm -rf ~/ocv-tmp
# Installing dlib
RUN pip3 install dlib
# Copy all the files from the project’s root to the working directory
COPY src/ /src/
COPY model/ /model/
# Running Python Application
#CMD ["python3", "/src/main.py"]
ENTRYPOINT ["python3", "/src/main.py"]