Fix issue with MySQL & deployment

This commit is contained in:
Brendan LE GLAUNEC
2016-06-03 09:07:07 +02:00
committed by Brendan Le Glaunec
parent 4633d3f520
commit 85c816c8cb
3 changed files with 10 additions and 4 deletions
@@ -21,5 +21,5 @@
// if you're not familiar with Docker, only change the // if you're not familiar with Docker, only change the
// cache_manager_name value // cache_manager_name value
"cache_manager_path" : "../cache_managers", "cache_manager_path" : "../cache_managers",
"cache_manager_name" : "mysql" "cache_manager_name" : "dumb"
} }
+2 -2
View File
@@ -6,8 +6,8 @@ cameradar:
- "./conf:/tmp/conf:ro" - "./conf:/tmp/conf:ro"
- "./cameradar_thumbnails:/tmp/cameradar_thumbnails" - "./cameradar_thumbnails:/tmp/cameradar_thumbnails"
links: links:
- ext_cctv_mysql - mysql
ext_cctv_mysql: mysql:
image: mysql:5.7 image: mysql:5.7
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
+7 -1
View File
@@ -27,12 +27,18 @@ echo -e $COL_GREEN"ok"$COL_RESET
# container. The container has to be linked in docker-compose.yml for cameradar # container. The container has to be linked in docker-compose.yml for cameradar
# to be able to interact with it. # to be able to interact with it.
echo -n "replacing mysql host and port in configuration " 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 # Reaplce 3306 with the port of your DB
sed -i s#__MYSQL_PORT__#3306#g $CONF sed -i s#__MYSQL_PORT__#3306#g $CONF
echo -e $COL_GREEN"ok"$COL_RESET 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/bin/cameradar -l 1 -c /conf/cameradar.conf.json &
cameradar_pid=$! cameradar_pid=$!