From 037a04e8b576a5172ec27e0a5efd7d42124cc294 Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 30 Apr 2026 12:35:54 -0400 Subject: [PATCH] fix(index-builder): bundle Pages Functions into _worker.js at build time Every index-builder deploy was overwriting the production Pages deployment without functions (wrangler ran from /tmp, no functions/ dir visible). Compiling functions/ to dist/_worker.js during the Docker web-builder stage means the worker is always included in every Pages deploy, regardless of CWD. Co-Authored-By: Claude Sonnet 4.6 --- cmd/acb-index-builder/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/acb-index-builder/Dockerfile b/cmd/acb-index-builder/Dockerfile index 9135ccf..a9cd4ed 100644 --- a/cmd/acb-index-builder/Dockerfile +++ b/cmd/acb-index-builder/Dockerfile @@ -5,6 +5,9 @@ COPY web/package.json web/package-lock.json ./ RUN npm ci COPY web/ . RUN npm run build +# Bundle Pages Functions (functions/ dir) into dist/_worker.js so the +# wrangler deploy from the index-builder runtime includes the R2 proxy function. +RUN npx wrangler pages functions build --outfile dist/_worker.js # Go binary build stage FROM golang:1.25-alpine AS builder