-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 953 Bytes
/
Copy pathDockerfile
File metadata and controls
41 lines (29 loc) · 953 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
32
33
34
35
36
37
38
39
40
41
# syntax=docker/dockerfile:1
ARG GO_IMAGE=golang:1.26.5-bookworm
FROM ${GO_IMAGE} AS builder
ENV CGO_ENABLED=0 \
GOFLAGS="-buildvcs=false -mod=readonly" \
GOPROXY=https://goproxy.cn,direct \
GOSUMDB=sum.golang.google.cn \
GOTOOLCHAIN=local
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION=dev
ARG SOURCE_DATE_EPOCH=0
RUN VERSION="${VERSION}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" \
/workspace/scripts/container-build.sh release
FROM scratch AS runtime
ENV TZ=Asia/Shanghai
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
COPY --from=builder /out/release/milog /app/milog
COPY conf/app.conf /app/conf/app.conf
COPY migrations /app/migrations
COPY static /app/static
COPY views /app/views
USER 65532:65532
EXPOSE 9001
ENTRYPOINT ["/app/milog"]