Fix issue with MySQL & deployment
This commit is contained in:
committed by
Brendan Le Glaunec
parent
4633d3f520
commit
85c816c8cb
@@ -21,5 +21,5 @@
|
||||
// if you're not familiar with Docker, only change the
|
||||
// cache_manager_name value
|
||||
"cache_manager_path" : "../cache_managers",
|
||||
"cache_manager_name" : "mysql"
|
||||
"cache_manager_name" : "dumb"
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ cameradar:
|
||||
- "./conf:/tmp/conf:ro"
|
||||
- "./cameradar_thumbnails:/tmp/cameradar_thumbnails"
|
||||
links:
|
||||
- ext_cctv_mysql
|
||||
ext_cctv_mysql:
|
||||
- mysql
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
|
||||
+7
-1
@@ -27,12 +27,18 @@ echo -e $COL_GREEN"ok"$COL_RESET
|
||||
# container. The container has to be linked in docker-compose.yml for cameradar
|
||||
# to be able to interact with it.
|
||||
echo -n "replacing mysql host and port in configuration "
|
||||
sed -i s#__MYSQL_ADDR__#ext_cctv_mysql#g $CONF
|
||||
sed -i s#__MYSQL_ADDR__#mysql#g $CONF
|
||||
|
||||
# Reaplce 3306 with the port of your DB
|
||||
sed -i s#__MYSQL_PORT__#3306#g $CONF
|
||||
echo -e $COL_GREEN"ok"$COL_RESET
|
||||
|
||||
echo -n "waiting for mysql to be ready "
|
||||
while ! mysqladmin ping -h"mysql" -P3306 --silent; do
|
||||
sleep 1
|
||||
done
|
||||
echo -e $COL_GREEN"ok"$COL_RESET
|
||||
|
||||
/cameradar/bin/cameradar -l 1 -c /conf/cameradar.conf.json &
|
||||
cameradar_pid=$!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user