-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.aiortc_yolo_worker
133 lines (92 loc) · 3.28 KB
/
Dockerfile.aiortc_yolo_worker
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# 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 step --
RUN apt update
RUN 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
# -- timezone で止まる
RUN apt install libopencv-dev -y
# RUN DEBIAN_FRONTEND=nonineractive apt install libopencv-dev -y
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
#-- copy ---
#COPY server2.py /root/work/aiortc/examples/server/
#COPY server_yolo.py /root/work/aiortc/examples/server/
#
# ------ 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
# --- 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_worker.py /root/work/aiortc/examples/server/
RUN cp /root/work/aiortc_yolov3/index_w.html /root/work/aiortc/examples/server/index.html
RUN cp /root/work/aiortc_yolov3/client_w.js /root/work/aiortc/examples/server/client.js
#COPY index_w.html /root/work/aiortc/examples/server/index.html
#COPY client_w.js /root/work/aiortc/examples/server/client.js
##COPY client.js /root/work/aiortc/examples/server/client.js
#COPY server_yolo_worker.py /root/work/aiortc/examples/server/
# --- for running --
EXPOSE 8080
WORKDIR /root/work/aiortc/examples/server/
#CMD [ "python3", "server_yolo.py" ]
CMD [ "python3", "server_yolo_worker.py" ]
# ----
# memo
# ----
# -- to build --
# docker build -t mganeko/aiortc-yolov3 -f Dockerfile.aiortc_yolo .
# docker build -t mganeko/aiortc-yolov3 -f Dockerfile.aiortc_yolo_worker .
# docker build --no-cache=true -t mganeko/aiortc-yolov3 -f Dockerfile.aiortc_yolo .
# -- bash --
# docker run -it mganeko/aiortc-yolov3 bash
# docker run -it -p 8001:8080 mganeko/aiortc-yolov3 bash
#
# docker run -it -v /Users/ganeko/project/docker/aiortc/temp:/root/work/temp mganeko/aiortc-yolov3 bash
# -- run yolo --
# ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
#
# python3 python/darknet-tiny.py
# -- run --
# docker run -d -p 8001:8080 --name aio mganeko/aiortc-yolov3
# -- stop --
# docker stop 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