build: Add cache mounts to Dockerfile for faster Go binary compilation.
This commit is contained in:
@@ -51,8 +51,10 @@ COPY backend/ ./
|
||||
# Copy frontend dist from previous stage
|
||||
COPY --from=frontend-builder /app/frontend/dist ./internal/web/dist
|
||||
|
||||
# Build the binary with embed tag
|
||||
RUN GOTOOLCHAIN=auto CGO_ENABLED=1 GOOS=linux go build \
|
||||
# Build the binary with embed tag (使用缓存加速)
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/go/pkg/mod \
|
||||
GOTOOLCHAIN=auto CGO_ENABLED=1 GOOS=linux go build \
|
||||
-tags embed \
|
||||
-ldflags="-s -w" \
|
||||
-o /app/codex-pool \
|
||||
|
||||
Reference in New Issue
Block a user