From 8ef5525c73f9422574302acd414c9c9eba3d67e2 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sun, 11 Oct 2020 18:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b38d23..09863b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,7 @@ #使用alpine作为基础镜像 FROM node:current-alpine3.12 -# 设置时区为上海 -RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ - && echo "Asia/Shanghai" > /etc/timezone \ - && apk del tzdata + #拷贝公钥免密克隆仓库代码 COPY .ssh /root/.ssh #拷贝到容器里的密钥需要修改权限才能正常使用 @@ -18,8 +15,12 @@ RUN ln -s /app/* /usr/local/bin/ && chmod +x /app/* COPY admin@openresty.com-5ea678a6.rsa.pub /etc/apk/keys/admin@openresty.com-5ea678a6.rsa.pub RUN echo "http://openresty.org/package/alpine/v3.12/main" \ | 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 +#使用阿里云镜像源安装库 +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add git openssh curl openresty tzdata +# 设置时区为上海 +RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + && echo "Asia/Shanghai" > /etc/timezone \ + && apk del tzdata WORKDIR /usr/local/openresty/nginx #备份openresty默认配置,拷贝自定义配置 RUN mv conf/nginx.conf conf/nginx.conf.bak