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 frontend dist from previous stage
|
||||||
COPY --from=frontend-builder /app/frontend/dist ./internal/web/dist
|
COPY --from=frontend-builder /app/frontend/dist ./internal/web/dist
|
||||||
|
|
||||||
# Build the binary with embed tag
|
# Build the binary with embed tag (使用缓存加速)
|
||||||
RUN GOTOOLCHAIN=auto CGO_ENABLED=1 GOOS=linux go build \
|
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 \
|
-tags embed \
|
||||||
-ldflags="-s -w" \
|
-ldflags="-s -w" \
|
||||||
-o /app/codex-pool \
|
-o /app/codex-pool \
|
||||||
|
|||||||
Reference in New Issue
Block a user