-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
117 lines (86 loc) · 2.66 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Ubuntu 18.04 and aiortc
# aiortc: https://github.com/jlaine/aiortc
FROM ubuntu:18.04
MAINTAINER mganeko
#
# -- if you are using docker behind proxy, please set ENV --
#
#ENV http_proxy "http://proxy.yourdomain.com:8080/"
#ENV https_proxy "http://proxy.yourdomain.com:8080/"
ENV DEBIAN_FRONTEND nonineractive
#
# -- build tools --
#
RUN apt update && apt upgrade -y
RUN apt install python3 -y
RUN apt install python3-pip -y
RUN apt install python3-dev -y
RUN python3 -V
RUN pip3 -V
RUN pip3 install --upgrade pip
RUN pip -V
RUN apt install libopus-dev -y
RUN apt install libvpx-dev -y
RUN apt install libffi-dev -y
RUN apt install libssl-dev -y
RUN apt install libopencv-dev -y
#
# -- aiortc --
#
RUN apt install git -y
RUN mkdir /root/work
WORKDIR /root/work/
RUN git clone https://github.com/jlaine/aiortc.git
RUN pip install aiohttp
RUN pip install aiortc
RUN pip install opencv-python
#
# ------ yolo v3 ---
#
RUN apt install vim -y
RUN apt install wget -y
WORKDIR /root/work/
RUN git clone https://github.com/pjreddie/darknet.git
WORKDIR /root/work/darknet
RUN make
RUN wget https://pjreddie.com/media/files/yolov3.weights
RUN wget https://pjreddie.com/media/files/yolov3-tiny.weights
RUN ln -s /root/work/darknet/libdarknet.so /usr/lib/libdarknet.so
#-- copy darknet sample ---
WORKDIR /root/work/
RUN git clone https://github.com/mganeko/python3_yolov3.git
RUN cp /root/work/python3_yolov3/darknet-tiny-label.py /root/work/darknet/python/
# --- link ---
RUN ln -s /root/work/darknet/cfg /root/work/aiortc/examples/server/
RUN ln -s /root/work/darknet/data /root/work/aiortc/examples/server/
RUN ln -s /root/work/darknet/yolov3-tiny.weights /root/work/aiortc/examples/server/
#-- copy ---
WORKDIR /root/work/
RUN git clone https://github.com/mganeko/aiortc_yolov3.git
RUN cp /root/work/aiortc_yolov3/server_yolo.py /root/work/aiortc/examples/server/
RUN cp /root/work/aiortc_yolov3/index.html /root/work/aiortc/examples/server/
#COPY server_yolo.py /root/work/aiortc/examples/server/
#COPY index.html /root/work/aiortc/examples/server/
# --- for running --
EXPOSE 8080
WORKDIR /root/work/aiortc/examples/server/
CMD [ "python3", "server_yolo.py" ]
# ----
# memo
# ----
# -- to build --
# docker build -t mganeko/aiortc-yolov3 -f Dockerfile .
#
# docker build --no-cache=true -t mganeko/aiortc-yolov3 -f Dockerfile .
# -- bash --
# docker run -it mganeko/aiortc-yolov3 bash
# -- run --
# docker run -d -p 8001:8080 --name aio mganeko/aiortc-yolov3
# -- stop & remove --
# docker stop aio
# -- remove ---
# docker rm aio
# -- remove stoped container ---
# docker rm $(docker ps -q -f status=exited)
# -- connect to running container ---
# docker exec -i -t {id or name} /bin/bash