-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 763 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (21 loc) · 763 Bytes
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
FROM golang:1.17-alpine as builder
WORKDIR /app
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct \
CGO_ENABLED=0
# cache
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY . .
RUN go build -trimpath -ldflags '-w -s' -o pure-live .
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache ca-certificates
RUN mkdir build && cp pure-live build && cp -r static build \
&& mkdir build/config && mv config/server.yaml.example build/config/server.yaml \
&& mv config/account.yaml.example build/config/account.yaml
FROM scratch
COPY --from=builder /app/build /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
EXPOSE 8800
ENTRYPOINT ["/pure-live","run"]