diff --git a/README.md b/README.md
index 71343a3..f53e2c1 100644
--- a/README.md
+++ b/README.md
@@ -139,7 +139,7 @@ A collection of delicious docker recipes.
- [x] phpvirtualbox-arm
- [x] piwik
- [x] revive
-- [x] zoneminder
+- [x] zoneminder :+1:
## Builder
diff --git a/ngrokd/README.md b/ngrokd/README.md
index c9bf0c3..6e27c2d 100644
--- a/ngrokd/README.md
+++ b/ngrokd/README.md
@@ -85,7 +85,6 @@ $ docker-compose logs service
# /etc/ngrok/ngrok.yml
authtoken: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
console_ui: false
-log: stdout
region: ap
web_addr: 0.0.0.0:4040
tunnels:
@@ -103,11 +102,12 @@ tunnels:
```ini
# /etc/systemd/system/ngrok.service
[Unit]
-Description=Ngrok Daemon
+Description=Secure Tunnels To Localhost
+Documentation=https://ngrok.com/docs
After=network.target
[Service]
-ExecStart=/usr/bin/ngrok start --config /etc/ngrok/ngrok.yml --all
+ExecStart=/usr/bin/ngrok start --config /etc/ngrok/ngrok.yml --log stdout --all
RestartSec=10
Restart=always
diff --git a/zoneminder/Dockerfile b/zoneminder/Dockerfile
index 3045f4e..550a7c5 100644
--- a/zoneminder/Dockerfile
+++ b/zoneminder/Dockerfile
@@ -26,6 +26,8 @@ COPY nginx.conf /etc/nginx/sites-available/default
EXPOSE 80
CMD set -xe \
+ && mkdir -p /var/run/zm \
+ && chown www-data:www-data /var/run/zm \
&& /etc/init.d/fcgiwrap start \
&& /etc/init.d/php5-fpm start \
&& nginx -g 'daemon off;'
diff --git a/zoneminder/README.md b/zoneminder/README.md
index 3088a62..cb695cc 100644
--- a/zoneminder/README.md
+++ b/zoneminder/README.md
@@ -22,15 +22,35 @@ zoneminder:
mysql:
image: mysql
volumes:
- - ./sql:/docker-entrypoint-initdb.d
+ - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
+ - ./mysql:/docker-entrypoint-initdb.d
+ - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
environment:
- MYSQL_ROOT_PASSWORD=root
restart: always
```
+> - `timezone = Asia/Shanghai` was hard-coded in Dockerfile.
+> - Make sure two containers have the same timezone.
+
+## up and running
+
+```bash
+$ docker-compose up -d
+```
+
+- Open
+- Add New Monitor
+ - Click Presets
+ - Change Source
+ - Save
+- Run State: Stopped -> Running
+
## references
-
-
+-
+-
[1]: https://www.zoneminder.com/
diff --git a/zoneminder/docker-compose.yml b/zoneminder/docker-compose.yml
index 18c261e..9a72feb 100644
--- a/zoneminder/docker-compose.yml
+++ b/zoneminder/docker-compose.yml
@@ -9,7 +9,9 @@ zoneminder:
mysql:
image: mysql
volumes:
- - ./sql:/docker-entrypoint-initdb.d
+ - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
+ - ./mysql:/docker-entrypoint-initdb.d
+ - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
environment:
- MYSQL_ROOT_PASSWORD=root
restart: always
diff --git a/zoneminder/sql/00-zm_create.sql b/zoneminder/mysql/00-zm_create.sql
similarity index 100%
rename from zoneminder/sql/00-zm_create.sql
rename to zoneminder/mysql/00-zm_create.sql
diff --git a/zoneminder/sql/01-zm_user.sql b/zoneminder/mysql/01-zm_user.sql
similarity index 100%
rename from zoneminder/sql/01-zm_user.sql
rename to zoneminder/mysql/01-zm_user.sql
diff --git a/zoneminder/mysql/my.cnf b/zoneminder/mysql/my.cnf
new file mode 100644
index 0000000..4ccf7c2
--- /dev/null
+++ b/zoneminder/mysql/my.cnf
@@ -0,0 +1,2 @@
+[mysqld]
+sql_mode = NO_ENGINE_SUBSTITUTION
diff --git a/zoneminder/nginx.conf b/zoneminder/nginx.conf
index efd2c22..5a2f9aa 100644
--- a/zoneminder/nginx.conf
+++ b/zoneminder/nginx.conf
@@ -13,12 +13,9 @@ server {
}
}
- location /zm/cgi-bin/ {
- alias /usr/lib/zoneminder/cgi-bin/;
- location ~ \.php$ {
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $request_filename;
- fastcgi_pass unix:/var/run/fcgiwrap.socket;
- }
+ location = /zm/cgi-bin/nph-zms {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/zoneminder/cgi-bin/nph-zms;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
}