diff --git a/Dockerfile b/Dockerfile index b64ff98..4167217 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +#使用alpine作为基础镜像 FROM node:current-alpine3.12 #拷贝公钥免密克隆仓库代码 @@ -28,8 +29,8 @@ RUN git clone git@gogs.kirito.cool:panqihua/RiskCloudRun.git WORKDIR /app/RiskCloudRun #安装依赖 RUN yarn - +#设置工作目录 WORKDIR /app -#运行web服务端 +#运行初始化脚本 ENTRYPOINT ["initRisk"] \ No newline at end of file diff --git a/shell/initRisk b/shell/initRisk index be3dfc6..0b7eb84 100644 --- a/shell/initRisk +++ b/shell/initRisk @@ -9,4 +9,4 @@ updateRisk RiskCloudFontend #运行openresty /usr/local/openresty/nginx/sbin/nginx #把自动部署服务端切换到前台进行,使容器不会停止运行 -fg \ No newline at end of file +fg %1 \ No newline at end of file diff --git a/shell/savePid b/shell/savePid index 6f67605..d926d7c 100644 --- a/shell/savePid +++ b/shell/savePid @@ -1,6 +1,5 @@ #!/bin/sh #保存应用进程pid -echo "findPort $1" #重试时间 second=5s while true @@ -12,7 +11,7 @@ while true sleep $second else echo "端口:$1的pid:`findPortPid $1`" - echo $pid>pid + findPortPid $1>pid break fi done