Skip to content

Commit 8735fcb

Browse files
committed
Docker images based on Alpine and Debian for microservices envirorments.
0 parents  commit 8735fcb

17 files changed

+1956
-0
lines changed

.dockerignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.git
2+
.gitignore
3+
.env
4+
README.md
5+
Dockerfile
6+
docker-compose*.yml
7+
node_modules
8+
videos
9+
dbdata
10+
runcontainer*.sh
11+
buildimage*.sh
12+
alpine
13+
debian
14+
ubuntu
15+
sql

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
node_modules
2+
videos
3+
events
4+
frames
5+
web.old
6+
.DS_Store
7+
.vagrant
8+
conf.json
9+
super.json
10+
dbdata
11+
npm-debug.log
12+
.vscode
13+
buildimage*.sh
14+
runcontainer*.sh
15+
UPDATE2PRO.sh
16+
*.NotWorking
17+
default_data.sql
18+
snippet_*

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
conf.json

COPYING

+674
Large diffs are not rendered by default.

LICENSE

+674
Large diffs are not rendered by default.

README.md

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# About this custom docker image for Shinobi Pro
2+
This image is designed to be used in a micro-service environment.
3+
Many thanks to [Shinobi Dev Team](https://shinobi.video/pro) for their great work!
4+
5+
# Shinobi Pro
6+
### (Creative Commons v4.0)
7+
8+
Shinobi is the Open Source CCTV Solution written in Node.JS. Designed with multiple account system, Streams by WebSocket, and Save to WebM. Shinobi can record IP Cameras and Local Cameras.
9+
10+
<a href="http://shinobi.video/gallery"><img src="https://github.com/ShinobiCCTV/Shinobi/blob/master/web/libs/img/demo.jpg?raw=true"></a>
11+
12+
# Key Aspects
13+
14+
For an updated list of features visit the official website. http://shinobi.video/features
15+
16+
- Time-lapse Viewer (Watch a hours worth of footage in a few minutes)
17+
- 2-Factor Authentication
18+
- Defeats stream limit imposed by browsers
19+
- With Base64 (Stream Type) and JPEG Mode (Option)
20+
- Records IP Cameras and Local Cameras
21+
- Streams by WebSocket, HLS (includes audio), and MJPEG
22+
- Save to WebM and MP4
23+
- Can save Audio
24+
- Push Events - When a video is finished it will appear in the dashboard without a refresh
25+
- Region Motion Detection (Similar to ZoneMinder Zone Detection)
26+
- Represented by a Motion Guage on each monitor
27+
- "No Motion" Notifications
28+
- 1 Process for Each Camera to do both, Recording and Streaming
29+
- Timeline for viewing Motion Events and Videos
30+
- Sub-Accounts with permissions
31+
- Monitor Viewing
32+
- Monitor Editing
33+
- Video Deleting
34+
- Separate API keys for sub account
35+
- Cron Filters can be set based on master account
36+
- Stream Analyzer built-in (FFprobe GUI)
37+
- Monitor Groups
38+
- Can snapshot images from stream directly
39+
- Lower Bandwith Mode (JPEG Mode)
40+
- Snapshot (cgi-bin) must be enabled in Monitor Settings
41+
- Control Cameras from Interface
42+
- API
43+
- Get videos
44+
- Get monitors
45+
- Change monitor modes : Disabled, Watch, Record
46+
- Embedding streams
47+
- Dashboard Framework made with Google Material Design Lite, jQuery, and Bootstrap
48+
49+
## Asking for help
50+
51+
Before asking questions it would nice if you read the docs :) http://shinobi.video
52+
53+
After doing so please head on over to the Discord community chat for support. https://discordapp.com/invite/mdhmvuH
54+
55+
The Issues section is only for bugs with the software. Comments and feature requests may be closed without comment. http://shinobi.video/docs/contribute
56+
57+
Please be considerate of developer efforts. If you have simple questions, like "what does this button do?", please be sure to have read the docs entirely before asking. If you would like to skip reading the docs and ask away you can order a support package :) http://shinobi.video/support
58+
59+
## Making Suggestions or Feature Requests
60+
61+
You can post suggestions in the Discord #suggestions channel. Please do not treat this channel like a "demands" window. Developer efforts are limited. Much more than many alternatives.
62+
63+
when you have a suggestion please try and make the changes yourself then post a pull request to the `dev` branch. Then we can decide if it's a good change for Shinobi. If you don't know how to go about it and want to have me put it higher on my priority list you can order a support package :) Pretty Ferengi of me... but until we live in a world without money please support Shinobi :) Cheers!
64+
65+
http://shinobi.video/support
66+
67+
## Help make Shinobi the best Open Source CCTV Solution.
68+
Donate - http://shinobi.video/docs/donate
69+
70+
Ordering a License, Paid Support, or anything from <a href="//camera.observer">here</a> will allow a lot more time to be spent on Shinobi.
71+
72+
Order Support - http://shinobi.video/support
73+
74+
# Why make this?
75+
76+
http://shinobi.video/why
77+
78+
# What others say
79+
80+
> "After trying zoneminder without success (heavy unstable and slow) I passed to Shinobi that despite being young spins a thousand times better (I have a setup with 16 cameras recording in FHD to ~ 10fps on a pentium of ~ 2009 and I turn with load below 1.5)."
81+
82+
> *A Reddit user, /r/ItalyInformatica*
83+
84+
&nbsp;
85+
86+
> "I would suggest Shinobi as a NVR. It's still in the early days but works a lot better than ZoneMinder for me. I'm able to record 16 cams at 1080p 15fps continously whith no load on server (Pentium E5500 3GB RAM) where zm crashed with 6 cams at 720p. Not to mention the better interface."
87+
88+
> *A Reddit user, /r/HomeNetworking*
89+
90+
# How to Install and Run
91+
92+
> FOR DOCKER USERS : Docker is not officially supported and is not recommended. The kitematic method is provided for those who wish to quickly test Shinobi. The Docker files included in the master and dev branches are maintained by the community. If you would like support with Docker please find a community member who maintains the Docker files or please refer to Docker's forum.
93+
94+
#### Fast Install (The Ninja Way)
95+
96+
1. Become `root` to use the installer and run Shinobi. Use one of the following to do so.
97+
98+
- Ubuntu 17.04, 17.10
99+
- `sudo su`
100+
- CentOS 7
101+
- `su`
102+
- MacOS 10.7(+)
103+
- `su`
104+
2. Download and run the installer.
105+
106+
```
107+
bash <(curl -s https://raw.githubusercontent.com/ShinobiCCTV/Shinobi-Installer/master/shinobi-install.sh)
108+
```
109+
110+
#### Elaborate Installs
111+
112+
Installation Tutorials - http://shinobi.video/docs/start
113+
114+
Troubleshooting Guide - http://shinobi.video/docs/start#trouble-section
115+
116+
# Author
117+
118+
Moe Alam
119+
120+
Follow Shinobi on Twitter https://twitter.com/ShinobiCCTV
121+
122+
Join the Community Chat
123+
124+
<a title="Find me on Discord, Get an Invite" href="https://discordapp.com/invite/mdhmvuH"><img src="https://cdn-images-1.medium.com/max/115/1*[email protected]"></a>
125+
126+
# Support the Development
127+
128+
Ordering a certificate or support package greatly boosts development. Please consider contributing :)
129+
130+
http://shinobi.video/support
131+
132+
# Links
133+
134+
Documentation - http://shinobi.video/docs
135+
136+
Donate - https://shinobi.video/docs/donate
137+
138+
Tested Cameras and Systems - http://shinobi.video/docs/supported
139+
140+
Features - http://shinobi.video/features
141+
142+
Reddit (Forum) - https://www.reddit.com/r/ShinobiCCTV/
143+
144+
YouTube (Tutorials) - https://www.youtube.com/channel/UCbgbBLTK-koTyjOmOxA9msQ
145+
146+
Discord (Community Chat) - https://discordapp.com/invite/mdhmvuH
147+
148+
Twitter (News) - https://twitter.com/ShinobiCCTV
149+
150+
Facebook (News) - https://www.facebook.com/Shinobi-1223193167773738/?ref=bookmarks

alpine/Dockerfile

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#
2+
# Builds a custom docker image for ShinobiCCTV Pro
3+
#
4+
FROM node:8-alpine
5+
6+
LABEL Author="MiGoller"
7+
8+
# Set environment variables to default values
9+
ENV MYSQL_USER=majesticflame \
10+
MYSQL_PASSWORD=password \
11+
MYSQL_HOST=127.0.0.1 \
12+
MYSQL_DATABASE=ccio \
13+
14+
ADMIN_PASSWORD=administrator \
15+
CRON_KEY=b59b5c62-57d0-4cd1-b068-a55e5222786f \
16+
PLUGINKEY_MOTION=49ad732d-1a4f-4931-8ab8-d74ff56dac57 \
17+
PLUGINKEY_OPENCV=6aa3487d-c613-457e-bba2-1deca10b7f5d \
18+
PLUGINKEY_OPENALPR=SomeOpenALPRkeySoPeopleDontMessWithYourShinobi \
19+
MOTION_HOST=localhost \
20+
MOTION_PORT=8080
21+
22+
# Create the custom configuration dir
23+
RUN mkdir -p /config
24+
25+
# Create the working dir
26+
RUN mkdir -p /opt/shinobi
27+
28+
WORKDIR /opt/shinobi
29+
30+
# Install package dependencies
31+
RUN apk add --update --no-cache ffmpeg python pkgconfig cairo-dev make g++ jpeg-dev git ttf-freefont
32+
# To-DO: Alpine ffmpeg is missing configuration "--enable-libfreetype"
33+
34+
# Clone the Shinobi CCTV PRO repo
35+
RUN mkdir master_temp
36+
RUN git clone https://github.com/ShinobiCCTV/Shinobi.git master_temp
37+
RUN cp -R -f master_temp/* .
38+
RUN rm -rf $distro master_temp
39+
40+
# Install NodeJS dependencies
41+
RUN npm install pm2 -g
42+
43+
RUN npm install && \
44+
npm install canvas moment --unsafe-perm
45+
46+
# Copy code
47+
COPY docker-entrypoint.sh .
48+
COPY pm2Shinobi.yml .
49+
50+
# Copy default configuration files
51+
COPY ./config/conf.sample.json /opt/shinobi/conf.sample.json
52+
COPY ./config/super.sample.json /opt/shinobi/super.sample.json
53+
COPY ./config/motion.conf.sample.json /opt/shinobi/plugins/motion/conf.sample.json
54+
55+
VOLUME ["/opt/shinobi/videos"]
56+
VOLUME ["/config"]
57+
58+
EXPOSE 8080
59+
60+
ENTRYPOINT ["/opt/shinobi/docker-entrypoint.sh"]
61+
62+
CMD ["pm2-docker", "pm2Shinobi.yml"]

config/conf.sample.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"port": 8080,
3+
"addStorage": [
4+
{"name":"second","path":"__DIR__/videos2"}
5+
],
6+
"db": {
7+
"host": "127.0.0.1",
8+
"user": "majesticflame",
9+
"password": "",
10+
"database": "ccio",
11+
"port":3306
12+
},
13+
"mail":{
14+
"service": "gmail",
15+
"auth": {
16+
"user": "[email protected]",
17+
"pass": "your_password_or_app_specific_password"
18+
}
19+
},
20+
"cron":{
21+
"key":"73ffd716-16ab-40f4-8c2e-aecbd3bc1d30"
22+
},
23+
"pluginKeys":{
24+
"Motion":"d4b5feb4-8f9c-4b91-bfec-277c641fc5e3",
25+
"OpenCV":"644bb8aa-8066-44b6-955a-073e6a745c74",
26+
"OpenALPR":"9973e390-f6cd-44a4-86d7-954df863cea0"
27+
},
28+
"productType":"Pro"
29+
}

config/motion.conf.sample.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plug":"Motion",
3+
"host":"localhost",
4+
"port":8080,
5+
"key":"d4b5feb4-8f9c-4b91-bfec-277c641fc5e3",
6+
"notice":"Looks like you have the Motion plugin running. Don't forget to enable <b>Send Frames</b> to start pushing frames to be read."
7+
}

config/super.sample.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
4+
"pass":"21232f297a57a5a743894a0e4a801fc3"
5+
}
6+
]

debian/Dockerfile

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#
2+
# Builds a custom docker image for ShinobiCCTV Pro
3+
#
4+
FROM node:8
5+
6+
LABEL Author="MiGoller"
7+
8+
# Set environment variables to default values
9+
ENV MYSQL_USER=majesticflame \
10+
MYSQL_PASSWORD=password \
11+
MYSQL_HOST=127.0.0.1 \
12+
MYSQL_DATABASE=ccio \
13+
14+
ADMIN_PASSWORD=administrator \
15+
CRON_KEY=b59b5c62-57d0-4cd1-b068-a55e5222786f \
16+
PLUGINKEY_MOTION=49ad732d-1a4f-4931-8ab8-d74ff56dac57 \
17+
PLUGINKEY_OPENCV=6aa3487d-c613-457e-bba2-1deca10b7f5d \
18+
PLUGINKEY_OPENALPR=SomeOpenALPRkeySoPeopleDontMessWithYourShinobi \
19+
MOTION_HOST=localhost \
20+
MOTION_PORT=8080
21+
22+
# Create the custom configuration dir
23+
RUN mkdir -p /config
24+
25+
# Create the working dir
26+
RUN mkdir -p /opt/shinobi
27+
28+
WORKDIR /opt/shinobi
29+
30+
# Install package dependencies
31+
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
32+
&& apt-get update \
33+
&& apt-get install -y ffmpeg python pkg-config libcairo-dev make g++ libjpeg-dev git
34+
35+
# Clone the Shinobi CCTV PRO repo
36+
RUN mkdir master_temp
37+
RUN git clone https://github.com/ShinobiCCTV/Shinobi.git master_temp
38+
RUN cp -R -f master_temp/* .
39+
RUN rm -rf $distro master_temp
40+
41+
# Install NodeJS dependencies
42+
RUN npm install pm2 -g
43+
44+
RUN npm install && \
45+
npm install canvas moment --unsafe-perm
46+
47+
# Copy code
48+
COPY docker-entrypoint.sh .
49+
COPY pm2Shinobi.yml .
50+
51+
# Copy default configuration files
52+
COPY ./config/conf.sample.json /opt/shinobi/conf.sample.json
53+
COPY ./config/super.sample.json /opt/shinobi/super.sample.json
54+
COPY ./config/motion.conf.sample.json /opt/shinobi/plugins/motion/conf.sample.json
55+
56+
VOLUME ["/opt/shinobi/videos"]
57+
VOLUME ["/config"]
58+
59+
EXPOSE 8080
60+
61+
ENTRYPOINT ["/opt/shinobi/docker-entrypoint.sh"]
62+
63+
CMD ["pm2-docker", "pm2Shinobi.yml"]

0 commit comments

Comments
 (0)