-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
37 lines (27 loc) · 920 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
################################################################################
## GO BUILDER
################################################################################
FROM golang:1.20.4 as builder
# FROM docker.m.daocloud.io/golang:1.18 as builder
ENV CGO_ENABLED 0
ENV BUILD_DIR /build
RUN mkdir -p ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN go env -w GO111MODULE=on
# RUN go env -w GOPROXY=https://goproxy.cn,direct
COPY go.* ./
RUN go mod download
COPY . .
# RUN make test
RUN make build
# ################################################################################
# ## DEPLOYMENT CONTAINER
# ################################################################################
FROM alpine
EXPOSE 8080
WORKDIR /app
RUN mkdir -p /app
COPY --from=builder /build/bin/public-binary-file-mirror /app/
COPY --from=builder /build/mirror.yaml /app/
ENTRYPOINT ["/app/public-binary-file-mirror"]
CMD ["serve"]