-
Notifications
You must be signed in to change notification settings - Fork 389
/
Dockerfile
29 lines (21 loc) · 742 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
FROM golang:1.20-alpine3.18 AS build
WORKDIR /usr/local/src/goproxy.cn
COPY . .
RUN apk add --no-cache git
RUN go mod download
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o bin/
FROM alpine:3.18
COPY --from=build /usr/local/src/goproxy.cn/bin/ /usr/local/bin/
COPY templates/ /goproxy.cn/templates/
COPY assets/ /goproxy.cn/assets/
COPY locales/ /goproxy.cn/locales/
COPY qas/ /goproxy.cn/qas/
COPY robots.txt favicon.ico apple-touch-icon.png unknown-badge.svg /goproxy.cn/
RUN apk add --no-cache go git git-lfs openssh gpg subversion fossil mercurial breezy
RUN git lfs install
ENV GOPATH=/tmp/gopath
ENV GOCACHE=/tmp/gocache
ENV GOPROXY=direct
ENV GOSUMDB=off
WORKDIR /goproxy.cn
ENTRYPOINT ["/usr/local/bin/goproxy.cn"]