添加docker支持

This commit is contained in:
2020-12-01 11:03:49 +08:00
parent fbc0c1e4f1
commit 1158907a6f
6 changed files with 103 additions and 7 deletions

27
entrypoint.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
# 设置环境变量
yq w config.yaml database.tables.qq $qq | yq w - database.tables.jd $jd | yq w - database.tables.sf $sf | yq w - database.tables.wb $wb | yq w - http.host $host | yq w - http.port $port | yq w - mask $mask | sponge config.yaml
# 如果不存在数据库,创建
if [[ ! -f database/database.db ]];then
mkdir -p database && sqlite3 database/database.db < scripts/database/create_database.sql
if [[ -f source/6.9更新总库.txt ]];then python scripts/qq.py;fi
if [[ -f source/www_jd_com_12g.txt ]];then python scripts/jd.py;fi
sqlite3 database/database.db < scripts/database/create_index.sql
fi
# 如果需要重新导入qq
if [[ -f database/.reimportqq ]];then
if [[ -f source/6.9更新总库.txt ]];then python scripts/qq.py;fi
rm database/.reimportqq
fi
# 如果需要重新导入jd
if [[ -f database/.reimportjd ]];then
if [[ -f source/www_jd_com_12g.txt ]];then python scripts/jd.py;fi
rm database/.reimportjd
fi
# 启动服务器
cd server && ./app