You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
riskshell/Dockerfile

35 lines
1.2 KiB

4 years ago
FROM node:current-alpine3.12
4 years ago
#拷贝公钥免密克隆仓库代码
4 years ago
COPY .ssh /root/.ssh
4 years ago
#拷贝到容器里的密钥需要修改权限才能正常使用
4 years ago
RUN chmod 400 /root/.ssh/id_rsa
4 years ago
RUN mkdir /app
4 years ago
#拷贝自动更新部署应用的命令
4 years ago
COPY shell/* /app/
4 years ago
#为命令建立软链接
4 years ago
RUN ln -s /app/* /usr/local/bin/ && chmod +x /app/*
4 years ago
#启用 openresty 仓库
COPY admin@openresty.com-5ea678a6.rsa.pub /etc/apk/keys/admin@openresty.com-5ea678a6.rsa.pub
4 years ago
RUN echo "http://openresty.org/package/alpine/v3.12/main" \
4 years ago
| tee -a /etc/apk/repositories
4 years ago
#使用阿里云镜像源安装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默认配置,拷贝自定义配置
4 years ago
RUN mv conf/nginx.conf conf/nginx.conf.bak
4 years ago
COPY conf/nginx.conf conf/nginx.conf
4 years ago
#添加openresty软链接
RUN ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/
4 years ago
#拷贝应用代码
4 years ago
WORKDIR /app
4 years ago
#git web钩子服务端
4 years ago
RUN git clone git@gogs.kirito.cool:panqihua/RiskCloudRun.git
WORKDIR /app/RiskCloudRun
4 years ago
#安装依赖
RUN yarn
4 years ago
4 years ago
WORKDIR /app
4 years ago
4 years ago
#运行web服务端
4 years ago
ENTRYPOINT ["initRisk"]