From e3576ae3536e5f93fc454999d27a5549b2a1e46d Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sun, 11 Oct 2020 17:15:38 +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 --- .gitignore | 3 ++- Dockerfile | 4 ++++ run | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 723ef36..bf3465c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea \ No newline at end of file +.idea +/test diff --git a/Dockerfile b/Dockerfile index c75190d..4b38d23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ #使用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 #拷贝到容器里的密钥需要修改权限才能正常使用 diff --git a/run b/run index 3a601df..3229f30 100644 --- a/run +++ b/run @@ -1,3 +1,3 @@ #!/bin/sh #创建运行容器 -docker run --name test -p 3000:3000 -p 8080:8080 test:1.0 +docker run -dit --name test -p 3000:3000 -p 8080:8080 test:1.0