JM-WechatMini/Dockerfile

25 lines
684 B
Docker
Raw Normal View History

2024-03-31 04:15:39 +08:00
FROM golang:alpine as builder
2023-11-02 04:34:46 +08:00
WORKDIR /go/src/miniapp
COPY . .
RUN go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w CGO_ENABLED=0 \
&& go env \
&& go mod tidy \
2024-01-11 16:03:51 +08:00
&& go build -o server .
2023-11-02 04:34:46 +08:00
2024-03-31 04:15:39 +08:00
FROM code.hyxc1.com/open/alpine:3.16.0 as runner
2023-11-02 04:34:46 +08:00
WORKDIR /go/src/miniapp
COPY --from=0 /go/src/miniapp/server ./
COPY --from=0 /go/src/miniapp/resource ./resource/
2024-03-21 21:08:45 +08:00
COPY --from=0 /go/src/miniapp/docker/config.docker.yaml ./docker/
COPY --from=0 /go/src/miniapp/docker ./
2023-11-02 04:34:46 +08:00
2024-03-31 04:10:36 +08:00
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo "Asia/Shanghai" > /etc/timezone
2023-11-02 04:34:46 +08:00
EXPOSE 8888
2024-03-21 21:08:45 +08:00
ENTRYPOINT ./server -c docker/config.docker.yaml