-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
107 lines (91 loc) · 2.88 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
#
# Builds a custom docker image for ShinobiCCTV Pro
#
FROM node:8-alpine
LABEL Author="MiGoller, mrproper, pschmitt & moeiscool"
# Set environment variables to default values
# ADMIN_USER : the super user login name
# ADMIN_PASSWORD : the super user login password
# PLUGINKEY_MOTION : motion plugin connection key
# PLUGINKEY_OPENCV : opencv plugin connection key
# PLUGINKEY_OPENALPR : openalpr plugin connection key
ENV [email protected] \
ADMIN_PASSWORD=admin \
CRON_KEY=fd6c7849-904d-47ea-922b-5143358ba0de \
PLUGINKEY_MOTION=b7502fd9-506c-4dda-9b56-8e699a6bc41c \
PLUGINKEY_OPENCV=f078bcfe-c39a-4eb5-bd52-9382ca828e8a \
PLUGINKEY_OPENALPR=dbff574e-9d4a-44c1-b578-3dc0f1944a3c \
#leave these ENVs alone unless you know what you are doing
MYSQL_USER=majesticflame \
MYSQL_PASSWORD=password \
MYSQL_HOST=localhost \
MYSQL_DATABASE=ccio \
MYSQL_ROOT_PASSWORD=blubsblawoot \
MYSQL_ROOT_USER=root
# Create additional directories for: Custom configuration, working directory, database directory
RUN mkdir -p \
/config \
/opt/shinobi \
/var/lib/mysql
# Install package dependencies
RUN apk update && \
apk add --no-cache \
freetype-dev \
ffmpeg \
gnutls-dev \
lame-dev \
libass-dev \
libogg-dev \
libtheora-dev \
libvorbis-dev \
libvpx-dev \
libwebp-dev \
libssh2 \
opus-dev \
rtmpdump-dev \
x264-dev \
x265-dev \
yasm-dev && \
apk add --no-cache --virtual \
.build-dependencies \
build-base \
bzip2 \
coreutils \
gnutls \
nasm \
tar \
x264
# Install additional packages
RUN apk update && \
apk add --no-cache \
ffmpeg \
git \
make \
mariadb \
mariadb-client \
openrc \
pkgconfig \
python \
wget \
tar \
xz
RUN sed -ie "s/^skip-networking/#skip-networking/" /etc/my.cnf.d/mariadb-server.cnf*
# Assign working directory
WORKDIR /opt/shinobi
# Clone the Shinobi CCTV PRO repo and install Shinobi app including NodeJS dependencies
RUN git clone https://gitlab.com/Shinobi-Systems/Shinobi.git /opt/shinobi && \
npm i npm@latest -g && \
npm install pm2 -g && \
npm install
# Copy code
COPY docker-entrypoint.sh pm2Shinobi.yml ./
RUN chmod -f +x ./*.sh
# Copy default configuration files
COPY ./config/conf.sample.json ./config/super.sample.json /opt/shinobi/
COPY ./config/motion.conf.sample.json /opt/shinobi/plugins/motion/conf.sample.json
VOLUME ["/opt/shinobi/videos"]
VOLUME ["/config"]
VOLUME ["/var/lib/mysql"]
EXPOSE 8080
ENTRYPOINT ["/opt/shinobi/docker-entrypoint.sh"]
CMD ["pm2-docker", "pm2Shinobi.yml"]