增加openresty

master
pan 4 years ago
parent b0f4a5e583
commit da279228a4
  1. 13
      Dockerfile
  2. 0
      README.md
  3. 9
      admin@openresty.com-5ea678a6.rsa.pub
  4. 1
      build
  5. 20
      conf/nginx.conf
  6. 1
      delete
  7. 1
      exec
  8. 1
      run
  9. 6
      shell/initRisk

@ -9,8 +9,16 @@ RUN mkdir /app
COPY shell/* /app/
#为命令建立软链接
RUN ln -s /app/* /usr/local/bin/ && chmod +x /app/*
#使用阿里云镜像源安装git和openssh
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add git openssh curl
#启用 openresty 仓库
COPY admin@openresty.com-5ea678a6.rsa.pub /etc/apk/keys/admin@openresty.com-5ea678a6.rsa.pub
RUN MAJOR_VER=`echo $VERSION_ID | sed 's/\.[0-9]\+$//'` && echo "http://openresty.org/package/alpine/v$MAJOR_VER/main" \
| sudo tee -a /etc/apk/repositories
#使用阿里云镜像源安装git openssh curl openresty
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add git openssh curl openresty
WORKDIR /usr/local/openresty/nginx
#备份openresty默认配置,拷贝自定义配置
RUN move conf/nginx.conf conf/nginx.conf.bak
COPY conf/nginx.conf conf/nginx.conf
#拷贝应用代码
WORKDIR /app
#git web钩子服务端
@ -18,6 +26,7 @@ RUN git clone git@gogs.kirito.cool:panqihua/RiskCloudRun.git
WORKDIR /app/RiskCloudRun
#安装依赖
RUN yarn
WORKDIR /app
#运行web服务端

@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHjbPqu0JdFpIJ8cUqP3
aC01s/lqr42y3IeOjGckIRV3CewpI+FxONZ4e6uQmOVNYdv2r7Va2qxqRreQVtx8
rpwGgM/CGD8j5MZNTsA8u9hby4njy/2hCskNpMNmciPj5iOwokFoiegJOKYQktbg
Tcba+7QK1ThqaIxzv74p+xuEvVtW9FiAiyDPG4xGBxIDkI02qf3Mtd4Wgp9d5K8t
wD0hGVeLSbvbyHrrXLQXpukgymdQmqhNvWMLd7sApCFzl8JOq5NmsolARqBq69rK
LeW/mHzNSn/Sq8OJmEFKkZ+FGxp1tMpTgOGi+EAtspJ+u7HWi3Xb49Jtfhuw1Uzq
lQIDAQAB
-----END PUBLIC KEY-----

@ -0,0 +1 @@
git pull && docker build . -t test:1.0 --no-cache

@ -0,0 +1,20 @@
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location / {
access_by_lua '
local t = io.popen("checkPort")
local a = t:read("*all")
ngx.say("<h1>当前进程"..a.."</h1>")
';
}
}
}

@ -0,0 +1 @@
docker stop test && docker rm test && docker rmi test:1.0

@ -0,0 +1 @@
docker exec -it test /bin/sh

1
run

@ -0,0 +1 @@
docker run --name test -p 3000:3000 -p 2233:2233 -p 5000:5000 test:1.0 &

@ -3,9 +3,9 @@
#运行web服务端
updateRisk RiskCloudMock
#ENTRYPOINT ["updateRisk","RiskCloudMock"]
#运行web客户端
updateRisk RiskCloudFontend
#ENTRYPOINT ["updateRisk","RiskCloudFontend"]
#运行openresty
/usr/local/openresty/nginx/sbin/nginx
#运行自动部署服务端
node /app/RiskCloudRun/bin/www
node /app/RiskCloudRun/bin/www
Loading…
Cancel
Save