更新dockerfile

This commit is contained in:
whyour 2021-05-01 14:15:58 +08:00
parent 22a9b69e54
commit 74a2b56abc
3 changed files with 27 additions and 31 deletions

View File

@ -39,4 +39,4 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
&& yarn build-back \ && yarn build-back \
&& yarn install --production --network-timeout 100000 \ && yarn install --production --network-timeout 100000 \
&& yarn cache clean && yarn cache clean
ENTRYPOINT ["./docker-entrypoint.sh"] ENTRYPOINT ["./docker/docker-entrypoint.sh"]

View File

@ -2,7 +2,7 @@
set -e set -e
echo -e "======================1. 初始化命令========================\n" echo -e "======================1. 初始化命令========================\n"
dir_shell=$(dirname $(readlink -f "$0")) dir_shell=/ql/shell/
dir_root=$( dir_root=$(
cd $dir_shell cd $dir_shell
cd .. cd ..
@ -22,35 +22,7 @@ ql update
echo echo
echo -e "======================3. 检测配置文件========================\n" echo -e "======================3. 检测配置文件========================\n"
[ ! -d ${QL_DIR}/config ] && mkdir -p ${QL_DIR}/config fix_config
[ ! -d ${QL_DIR}/log ] && mkdir -p ${QL_DIR}/log
[ ! -d ${QL_DIR}/db ] && mkdir -p ${QL_DIR}/db
[ ! -d ${QL_DIR}/manual_log ] && mkdir -p ${QL_DIR}/manual_log
if [ ! -s ${QL_DIR}/config/cookie.sh ]; then
echo -e "检测到config配置目录下不存在cookie.sh从示例文件复制一份用于初始化...\n"
touch ${QL_DIR}/config/cookie.sh
echo
fi
if [ ! -s ${QL_DIR}/config/config.sh ]; then
echo -e "检测到config配置目录下不存在config.sh从示例文件复制一份用于初始化...\n"
cp -fv ${QL_DIR}/sample/config.sample.sh ${QL_DIR}/config/config.sh
echo
fi
if [ ! -s ${QL_DIR}/config/auth.sample.json ]; then
echo -e "检测到config配置目录下不存在auth.json从示例文件复制一份用于初始化...\n"
cp -fv ${QL_DIR}/sample/auth.sample.json ${QL_DIR}/config/auth.json
echo
fi
if [ -s /etc/nginx/conf.d/default.conf ]; then
echo -e "检测到默认nginx配置文件删除...\n"
rm -f /etc/nginx/conf.d/default.conf
echo
fi
cp -fv ${QL_DIR}/docker/front.conf /etc/nginx/conf.d/front.conf cp -fv ${QL_DIR}/docker/front.conf /etc/nginx/conf.d/front.conf
echo -e "======================4. 启动nginx========================\n" echo -e "======================4. 启动nginx========================\n"

View File

@ -5,6 +5,8 @@ dir_scripts=$dir_root/scripts
dir_repo=$dir_root/repo dir_repo=$dir_root/repo
dir_raw=$dir_scripts/raw dir_raw=$dir_scripts/raw
dir_log=$dir_root/log dir_log=$dir_root/log
dir_db=$dir_root/db
dir_manual_log=$dir_root/manual_log
dir_list_tmp=$dir_log/.tmp dir_list_tmp=$dir_log/.tmp
## 文件 ## 文件
@ -143,9 +145,31 @@ define_cmd () {
## 修复配置文件 ## 修复配置文件
fix_config () { fix_config () {
make_dir $dir_config make_dir $dir_config
make_dir $dir_log
make_dir $dir_db
make_dir $dir_manual_log
if [ ! -s $file_config_user ]; then if [ ! -s $file_config_user ]; then
echo -e "复制一份 $file_config_sample$file_config_user,随后请按注释编辑你的配置文件:$file_config_user\n" echo -e "复制一份 $file_config_sample$file_config_user,随后请按注释编辑你的配置文件:$file_config_user\n"
cp -fv $file_config_sample $file_config_user cp -fv $file_config_sample $file_config_user
echo echo
fi fi
if [ ! -s $file_cookie ]; then
echo -e "检测到config配置目录下不存在cookie.sh创建一个空文件用于初始化...\n"
touch $file_cookie
echo
fi
if [ ! -s $file_auth_user ]; then
echo -e "复制一份 $file_auth_sample$file_auth_user\n"
cp -fv $file_auth_sample $file_auth_user
echo
fi
if [ -s /etc/nginx/conf.d/default.conf ]; then
echo -e "检测到默认nginx配置文件删除...\n"
rm -f /etc/nginx/conf.d/default.conf
echo
fi
} }