fix(docker): add Go build cache mount and remove unnecessary -a flag
Add --mount=type=cache for Go build cache to speed up repeated builds. Remove the -a flag which forces full rebuilding of all packages and is unnecessary when using cache mounts.
This commit is contained in:
+2
-1
@@ -36,7 +36,8 @@ RUN npm run build:ts
|
||||
|
||||
# Build Go binary (cached unless Go files or generated code changes)
|
||||
RUN --mount=type=cache,target=/root/go/pkg/mod \
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd/server
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o main ./cmd/server
|
||||
|
||||
# Test runner stage - includes Go runtime and test dependencies
|
||||
# This stage is ONLY used for running tests, never deployed to production
|
||||
|
||||
Reference in New Issue
Block a user