mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 02:10:00 +08:00
Update docker.tpl (#4495)
This commit is contained in:
@@ -14,8 +14,8 @@ ADD go.mod .
|
|||||||
ADD go.sum .
|
ADD go.sum .
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
{{if .Argument}}COPY {{.GoRelPath}}/etc /app/etc
|
|
||||||
{{end}}RUN go build -ldflags="-s -w" -o /app/{{.ExeFile}} {{.GoMainFrom}}
|
RUN go build -ldflags="-s -w" -o /app/{{.ExeFile}} {{.GoMainFrom}}
|
||||||
|
|
||||||
|
|
||||||
FROM {{.BaseImage}}
|
FROM {{.BaseImage}}
|
||||||
@@ -25,8 +25,10 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certifi
|
|||||||
ENV TZ {{.Timezone}}
|
ENV TZ {{.Timezone}}
|
||||||
{{end}}
|
{{end}}
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /app/{{.ExeFile}} /app/{{.ExeFile}}{{if .Argument}}
|
COPY --from=builder /app/{{.ExeFile}} /app/{{.ExeFile}}
|
||||||
COPY --from=builder /app/etc /app/etc{{end}}
|
{{if .Argument}}COPY {{.GoRelPath}}/etc /app/etc
|
||||||
|
{{end}}
|
||||||
|
|
||||||
{{if .HasPort}}
|
{{if .HasPort}}
|
||||||
EXPOSE {{.Port}}
|
EXPOSE {{.Port}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
Reference in New Issue
Block a user