mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
chore: format Dockerfile template (#4496)
This commit is contained in:
parent
13746a3706
commit
ad291daf78
@ -4,10 +4,12 @@ LABEL stage=gobuilder
|
|||||||
|
|
||||||
ENV CGO_ENABLED 0
|
ENV CGO_ENABLED 0
|
||||||
{{if .Chinese}}ENV GOPROXY https://goproxy.cn,direct
|
{{if .Chinese}}ENV GOPROXY https://goproxy.cn,direct
|
||||||
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
{{end}}{{if .HasTimezone}}
|
{{- end}}{{if .HasTimezone}}
|
||||||
RUN apk update --no-cache && apk add --no-cache tzdata
|
RUN apk update --no-cache && apk add --no-cache tzdata
|
||||||
{{end}}
|
{{- end}}
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ADD go.mod .
|
ADD go.mod .
|
||||||
@ -21,14 +23,15 @@ RUN go build -ldflags="-s -w" -o /app/{{.ExeFile}} {{.GoMainFrom}}
|
|||||||
FROM {{.BaseImage}}
|
FROM {{.BaseImage}}
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
{{if .HasTimezone}}COPY --from=builder /usr/share/zoneinfo/{{.Timezone}} /usr/share/zoneinfo/{{.Timezone}}
|
{{if .HasTimezone -}}
|
||||||
|
COPY --from=builder /usr/share/zoneinfo/{{.Timezone}} /usr/share/zoneinfo/{{.Timezone}}
|
||||||
ENV TZ {{.Timezone}}
|
ENV TZ {{.Timezone}}
|
||||||
{{end}}
|
{{end}}
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /app/{{.ExeFile}} /app/{{.ExeFile}}
|
COPY --from=builder /app/{{.ExeFile}} /app/{{.ExeFile}}
|
||||||
{{if .Argument}}COPY {{.GoRelPath}}/etc /app/etc
|
{{if .Argument -}}
|
||||||
{{end}}
|
COPY {{.GoRelPath}}/etc /app/etc
|
||||||
|
{{- end}}
|
||||||
{{if .HasPort}}
|
{{if .HasPort}}
|
||||||
EXPOSE {{.Port}}
|
EXPOSE {{.Port}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
Loading…
Reference in New Issue
Block a user