Commit efa8a372 authored by zhengxiuming's avatar zhengxiuming

config fix

parent 915646b7
......@@ -5,7 +5,7 @@ ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /go/release
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add tzdata
# RUN apk update && apk add tzdata
COPY go.mod ./go.mod
RUN go mod tidy
......@@ -17,10 +17,16 @@ RUN go env && go build -o go-admin .
FROM alpine
ENV TZ=Asia/Shanghai
RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
&& apk --no-cache add tzdata zeromq \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo '$TZ' > /etc/timezone
COPY --from=builder /go/release/go-admin /
COPY --from=builder /go/release/config /config
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 8053
......
......@@ -5,21 +5,29 @@ ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /go/release
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add tzdata
# RUN apk update && apk add tzdata
COPY go.mod ./go.mod
RUN go mod tidy
COPY . .
RUN pwd && ls
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
# RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
RUN go env && go build -o go-admin .
FROM alpine
ENV TZ=Asia/Shanghai
RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
&& apk --no-cache add tzdata zeromq \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo '$TZ' > /etc/timezone
COPY --from=builder /go/release/go-admin /
COPY --from=builder /go/release/config /config
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 8052
EXPOSE 8054
CMD ["/go-admin","server","-c", "/config/settings.yml"]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment