-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
88 lines (76 loc) · 2.2 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
FROM resin/raspberry-pi2-debian:buster
EXPOSE 8080
RUN mkdir -p /usr/src/idmyteam
RUN apt-get -q update && apt-get -y upgrade && apt-get install -y \
build-essential \
git \
cmake \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavformat-dev \
libpq-dev \
libffi-dev \
libssl-dev \
libatlas-base-dev \
gfortran \
python-mysqldb \
libraspberrypi-bin \
python3-dev \
python3-setuptools \
imagemagick \
shellcheck \
supervisor && apt-get clean && rm -rf /var/lib/apt/lists/*
# install python 3.6
#RUN mkdir -p /tmp/python3
#WORKDIR /tmp/python3/
#RUN wget -O python.tar.xz https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
#RUN tar xJf python.tar.xz
#WORKDIR Python-3.6.3/
#RUN ./configure
#RUN make
#RUN make install
# install pip
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py && rm get-pip.py
RUN pip3 install --upgrade pip
RUN pip3 install numpy
#RUN dd if=/dev/zero of=/swapfile1GB bs=1M count=1024
#RUN mkswap /swapfile1GB
#RUN swapon /swapfile1GB
# install opencv
RUN mkdir -p /tmp/opencv
RUN wget -O /tmp/opencv/opencv.zip https://github.com/opencv/opencv/archive/4.0.0.zip
RUN wget -O /tmp/opencv/opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.0.0.zip
WORKDIR /tmp/opencv/
RUN unzip opencv_contrib.zip
RUN unzip opencv.zip
WORKDIR /tmp/opencv/opencv-4.0.0/
RUN mkdir build
WORKDIR /tmp/opencv/opencv-4.0.0/build/
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv/opencv_contrib-4.0.0/modules \
-D ENABLE_VFPV3=ON \
-D BUILD_TESTS=OFF \
-D ENABLE_NEON=ON \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF ..
RUN make -j2
RUN make install
RUN ldconfig
RUN rm -rf /tmp/opencv
RUN apt-get update && apt-get install -y python-opencv libffi-dev libmariadbclient-dev
RUN ln -s /usr/local/python/cv2/python-3.7/cv2.cpython-37m-arm-linux-gnueabihf.so /usr/local/lib/python3.7/dist-packages/
# init proj
WORKDIR /usr/src/idmyteam
COPY . .
RUN pip install -r requirements.txt
# background startup scripts
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]