forked from moeiscool/Shinobi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm32v7
40 lines (26 loc) · 1.41 KB
/
Dockerfile.arm32v7
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
FROM ogomez/arm32v7-alpine
EXPOSE 80
RUN apk add --update --no-cache ffmpeg python pkgconfig cairo-dev make g++ jpeg-dev nodejs nodejs-npm
VOLUME ["/opt/shinobi/videos"]
WORKDIR /opt/shinobi
ENV MYSQL_USER "shinobi"
ENV MYSQL_PASSWORD "shinobi"
ENV MYSQL_DATABASE "shinobi"
ENV MYSQL_HOST "127.0.0.1"
ADD ./package.json /tmp/package.json
RUN cd /tmp && npm install && npm install canvas
RUN mkdir -p /opt/shinobi && cp -a /tmp/node_modules /opt/shinobi/
ADD ./server /opt/shinobi
RUN cp /opt/shinobi/conf_sample.json /opt/shinobi/conf.json
RUN cp /opt/shinobi/plugins/motion/conf_sample.json /opt/shinobi/plugins/motion/conf.json
RUN cp /opt/shinobi/plugins/opencv/conf_sample.json /opt/shinobi/plugins/opencv/conf.json
RUN RUNDOM_CRON=`date +%s | sha256sum | base64 | head -c 32 ; echo`; sleep 1; \
RUNDOM_MOTION=`date +%s | sha256sum | base64 | head -c 32 ; echo`; sleep 1; \
RUNDOM_OPENCV=`date +%s | sha256sum | base64 | head -c 32 ; echo` \
&& sed -i "s#RUNDOM_MOTION#${RUNDOM_MOTION}#g" /opt/shinobi/plugins/motion/conf.json \
&& sed -i "s#RUNDOM_OPENCV#${RUNDOM_OPENCV}#g" /opt/shinobi/plugins/opencv/conf.json \
&& sed -i "s#RUNDOM_OPENCV#${RUNDOM_OPENCV}#g" /opt/shinobi/conf.json \
&& sed -i "s#RUNDOM_MOTION#${RUNDOM_MOTION}#g" /opt/shinobi/conf.json \
&& sed -i "s#RUNDOM_CRON#${RUNDOM_CRON}#g" /opt/shinobi/conf.json
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]