From 8615564c0b377efe1ed8bd8d0a90f7bef961a805 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sun, 11 Oct 2020 03:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0openresty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 +++-- shell/initRisk | 2 +- shell/savePid | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) 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