-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12b2e45
commit f35262e
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM golang:1.20-alpine AS builder | ||
|
||
LABEL stage=gobuilder | ||
|
||
ENV CGO_ENABLED 0 | ||
ENV GOPROXY https://goproxy.cn,direct | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | ||
|
||
RUN apk update --no-cache && apk add --no-cache tzdata | ||
|
||
WORKDIR /build | ||
|
||
ADD go.mod . | ||
ADD go.sum . | ||
RUN go mod download | ||
COPY . . | ||
RUN sh ./build.sh | ||
|
||
FROM alpine | ||
|
||
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai | ||
|
||
ENV TZ Asia/Shanghai | ||
|
||
WORKDIR /app | ||
COPY --from=builder /build/output /app | ||
|
||
CMD ["sh", "./bootstrap.sh"] |