作者 yangfu

add docker file

  1 +FROM golang:1.16 as builder
  2 +ENV APP_DIR $GOPATH/src/go-stash
  3 +RUN mkdir -p $APP_DIR
  4 +WORKDIR $APP_DIR/
  5 +COPY ./stash stash
  6 +COPY ./go.mod go.mod
  7 +ENV GO111MODULE on
  8 +ENV GOPROXY https://goproxy.cn,direct
  9 +RUN go mod tidy
  10 +RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w" -o ./stash/go-stash ./stash
  11 +
  12 +FROM alpine:latest
  13 +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
  14 + && apk add --no-cache tzdata \
  15 + && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  16 + && echo "Asia/Shanghai" > /etc/timezone \
  17 + && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache ## 清除缓存
  18 +WORKDIR /root/
  19 +COPY --from=builder /go/src/go-stash/stash .
  20 +ENTRYPOINT ["./go-stash"]
@@ -39,8 +39,8 @@ Clusters: @@ -39,8 +39,8 @@ Clusters:
39 Target: data 39 Target: data
40 Output: 40 Output:
41 Postgresql: 41 Postgresql:
42 - Host: "192.168.100.102"  
43 - Port: "5432" 42 + Host: "114.55.200.59"
  43 + Port: "31543"
44 User: "postgres" 44 User: "postgres"
45 - Password: "123456" 45 + Password: "eagle1010"
46 DBName: "mmm_log" 46 DBName: "mmm_log"