From 43c267784dde82f2d0486199a0f93ceb2429f274 Mon Sep 17 00:00:00 2001 From: ouqiang Date: Sun, 8 Jul 2018 22:43:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0docker=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- Dockerfile.release | 19 +++++++++++++++++++ README.md | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.release diff --git a/Dockerfile b/Dockerfile index d2702bc..c7f5aa8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,12 @@ RUN make install-vue \ FROM alpine:3.7 -RUN apk add --no-cache ca-certificates \ +RUN apk add --no-cache ca-certificates tzdata \ && addgroup -S app \ && adduser -S -g app app +RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + WORKDIR /app COPY --from=builder /go/src/github.com/ouqiang/gocron/bin/gocron . diff --git a/Dockerfile.release b/Dockerfile.release new file mode 100644 index 0000000..27abfa8 --- /dev/null +++ b/Dockerfile.release @@ -0,0 +1,19 @@ +FROM alpine:3.7 + +RUN apk add --no-cache ca-certificates tzdata \ + && addgroup -S app \ + && adduser -S -g app app + +RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +WORKDIR /app + +COPY gocron . + +RUN chown -R app:app ./ + +EXPOSE 5920 + +USER app + +ENTRYPOINT ["/app/gocron", "web"] diff --git a/README.md b/README.md index 28c8bb8..61afd08 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,12 @@ * gocron `./bin/gocron web` * gocron-node `./bin/gocron-node` + +### docker +```shell +docker run --name gocron -p 5920:5920 -d ouqg/gocron +``` + ### 开发 1. 安装Go1.9+, Node.js, Yarn