forked from pythonstock/stock
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yhy
committed
Jan 11, 2018
1 parent
47e0c3c
commit bafa967
Showing
5 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
DATE=`date +%Y-%m-%d:%H:%M:%S` | ||
echo $DATE | ||
|
||
if [ ! -d "/data/mariadb" ]; then | ||
mkdir -p /data/mariadb | ||
/usr/bin/mysql_install_db | ||
fi | ||
|
||
|
||
/usr/bin/mysqld_safe >> /data/logs/start_mariadb.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,19 @@ | ||
#!/bin/sh | ||
|
||
|
||
HAS_TF=`docker images tensorflow/tensorflow | wc -l ` | ||
if [ $HAS_TF -lt 2 ];then | ||
docker pull tensorflow/tensorflow:latest-devel | ||
fi | ||
|
||
HAS_TF_BASE=`docker images github.com/pythonstock/stock/tensorflow-py3 | wc -l ` | ||
if [ $HAS_TF -lt 2 ];then | ||
sh buildBase.sh | ||
fi | ||
|
||
HAS_TF_BASE=`docker images github.com/pythonstock/stock/tensorflow-py3-stock | wc -l ` | ||
if [ $HAS_TF -lt 2 ];then | ||
sh buildStock.sh | ||
fi | ||
|
||
DB_IS_RUN=`docker ps --filter "name=mariadb" --filter "status=running" | wc -l ` | ||
if [ $DB_IS_RUN -lt 2 ]; then | ||
sh startMysql.sh | ||
fi | ||
|
||
#检查stock启动 | ||
STOCK_IS_RUN=`docker ps --filter "name=stock" --filter "status=running" | wc -l ` | ||
STOCK_IS_RUN=`docker ps --filter "name=pythonstock" --filter "status=running" | wc -l ` | ||
if [ $STOCK_IS_RUN -ge 2 ]; then | ||
echo "stop & rm stock ..." | ||
docker stop stock && docker rm stock | ||
echo "stop & rm pythonstock ..." | ||
docker stop pythonstock && docker rm pythonstock | ||
fi | ||
|
||
sleep 1 | ||
|
||
echo "starting stock ..." | ||
echo "starting pythonstock ..." | ||
# /data/stock 是代码目录 -v /data/stock:/data/stock 是开发模式。 | ||
docker run -itd --link=mariadb --name stock \ | ||
docker run -itd --name pythonstock \ | ||
-p 8888:8888 \ | ||
-p 6006:6006 \ | ||
-p 9999:9999 \ | ||
-p 8500:8500 \ | ||
github.com/pythonstock/stock/tensorflow-py3-stock:latest | ||
pythonstock/pythonstock:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters