From 6fcd7f4400fa1296e825fcaed66eb0352a69caf2 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 24 May 2026 21:20:12 -0400 Subject: [PATCH] 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. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 10f29da..3a9c6a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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