chore(build): Optimize Docker build configuration and process

This commit is contained in:
begoniezhao
2025-09-18 17:26:02 +08:00
parent 8f723b38fb
commit a5c3623a02
+1 -1
View File
@@ -24,6 +24,7 @@ RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download
RUN --mount=type=cache,target=/go/pkg/mod cp -r /go/pkg/mod/github.com/yanyiwu/ /app/yanyiwu/
COPY . .
# Get version and commit info for build injection
ARG VERSION_ARG
@@ -38,7 +39,6 @@ ENV BUILD_TIME=${BUILD_TIME_ARG}
ENV GO_VERSION=${GO_VERSION_ARG}
# Build the application with version info
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod make build-prod
# Final stage