🎨 修改dockerfile

This commit is contained in:
loser 2024-03-31 04:10:36 +08:00
parent 1bd7ead544
commit e32cce111d

View File

@ -1,4 +1,4 @@
FROM golang:alpine as builder FROM registry.cn-hangzhou.aliyuncs.com/hyxc/golang:alpine-1.18 as builder
WORKDIR /go/src/miniapp WORKDIR /go/src/miniapp
COPY . . COPY . .
@ -10,7 +10,7 @@ RUN go env -w GO111MODULE=on \
&& go mod tidy \ && go mod tidy \
&& go build -o server . && go build -o server .
FROM alpine:latest FROM registry.cn-hangzhou.aliyuncs.com/hyxc/alpine:3.13.6 as runner
WORKDIR /go/src/miniapp WORKDIR /go/src/miniapp
COPY --from=0 /go/src/miniapp/server ./ COPY --from=0 /go/src/miniapp/server ./
@ -18,5 +18,7 @@ COPY --from=0 /go/src/miniapp/resource ./resource/
COPY --from=0 /go/src/miniapp/docker/config.docker.yaml ./docker/ COPY --from=0 /go/src/miniapp/docker/config.docker.yaml ./docker/
COPY --from=0 /go/src/miniapp/docker ./ COPY --from=0 /go/src/miniapp/docker ./
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo "Asia/Shanghai" > /etc/timezone
EXPOSE 8888 EXPOSE 8888
ENTRYPOINT ./server -c docker/config.docker.yaml ENTRYPOINT ./server -c docker/config.docker.yaml