JM-WechatMini/Dockerfile
2024-03-31 04:15:39 +08:00

25 lines
684 B
Docker

FROM golang:alpine as builder
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 \
&& go build -o server .
FROM code.hyxc1.com/open/alpine:3.16.0 as runner
WORKDIR /go/src/miniapp
COPY --from=0 /go/src/miniapp/server ./
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 ./
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo "Asia/Shanghai" > /etc/timezone
EXPOSE 8888
ENTRYPOINT ./server -c docker/config.docker.yaml