JM-WechatMini/Dockerfile

22 lines
476 B
Docker
Raw Normal View History

2023-11-02 04:34:46 +08:00
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 \
2024-01-11 16:03:51 +08:00
&& go build -o server .
2023-11-02 04:34:46 +08:00
FROM alpine:latest
WORKDIR /go/src/miniapp
COPY --from=0 /go/src/miniapp/server ./
COPY --from=0 /go/src/miniapp/resource ./resource/
2024-01-11 16:03:51 +08:00
COPY --from=0 /go/src/miniapp/config.yaml ./
2023-11-02 04:34:46 +08:00
EXPOSE 8888
2024-01-11 16:03:51 +08:00
ENTRYPOINT ./server -c config.yaml