|
35 | 35 | "class_name": "PrimalPrinting", |
36 | 36 | "image": "./Dockerfile", |
37 | 37 | "max_instances": 1, |
38 | | - // Forward Turborepo Remote Cache credentials from the Cloudflare |
39 | | - // Workers Build environment into the container build as |
40 | | - // docker `--build-arg` values. The ${VAR} placeholders are |
41 | | - // substituted by wrangler at deploy time from the build env, so |
42 | | - // no secret values are ever committed to this file. |
| 38 | + // Non-secret build-time values — passed through to the docker |
| 39 | + // build as --build-args. Stored here (not in the dashboard) so |
| 40 | + // they're version-controlled and reviewable. |
43 | 41 | // |
44 | | - // Only the two vars actually needed for Vercel-hosted Remote |
45 | | - // Cache are listed here. If you self-host or sign cache |
46 | | - // artefacts, add `"TURBO_API": "${TURBO_API}"` and/or |
47 | | - // `"TURBO_REMOTE_CACHE_SIGNATURE_KEY": "${TURBO_REMOTE_CACHE_SIGNATURE_KEY}"` |
48 | | - // once those env vars are set in the Cloudflare build env — |
49 | | - // referencing an unset env var here makes wrangler pass through |
50 | | - // the literal "${TURBO_API}" string, which Turbo then treats as |
51 | | - // a (broken) cache URL. |
| 42 | + // Note: image_vars passes values *literally* — there is NO |
| 43 | + // ${VAR} interpolation against the build env. Hardcode strings. |
52 | 44 | // |
53 | | - // Configure these in the Cloudflare dashboard: |
54 | | - // Workers & Pages → primalprinting → Settings → Builds → |
55 | | - // Variables and Secrets |
56 | | - // (mark TURBO_TOKEN, R2_SECRET_ACCESS_KEY as "Secret") |
57 | | - // |
58 | | - // R2_* vars feed the build-time `pnpm upload-assets` step that |
59 | | - // mirrors .next/static + public/ to the assets bucket so Next's |
60 | | - // `assetPrefix` can serve them from the CDN. They reuse the |
61 | | - // same R2 credentials already configured for runtime media |
62 | | - // access — only the bucket differs (R2_ASSETS_BUCKET). |
63 | | - // |
64 | | - // NEXT_PUBLIC_ASSET_PREFIX is baked into the client bundle at |
65 | | - // build time (Next inlines NEXT_PUBLIC_* vars). The runtime |
66 | | - // value is also injected via the worker env passthrough in |
67 | | - // container-worker.js so the entrypoint placeholder swap can |
68 | | - // re-target a different CDN per deploy if needed. |
| 45 | + // Secrets (TURBO_TOKEN, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY) |
| 46 | + // stay in the dashboard's "Build configuration → Variables and |
| 47 | + // Secrets" — Cloudflare auto-forwards them as --build-args |
| 48 | + // alongside these. |
69 | 49 | "image_vars": { |
70 | | - "TURBO_TEAM": "${TURBO_TEAM}", |
71 | | - "TURBO_TOKEN": "${TURBO_TOKEN}", |
72 | | - "NEXT_PUBLIC_ASSET_PREFIX": "${NEXT_PUBLIC_ASSET_PREFIX}", |
73 | | - "R2_ASSETS_BUCKET": "${R2_ASSETS_BUCKET}", |
74 | | - "R2_S3_ENDPOINT": "${R2_S3_ENDPOINT}", |
75 | | - "R2_ACCESS_KEY_ID": "${R2_ACCESS_KEY_ID}", |
76 | | - "R2_SECRET_ACCESS_KEY": "${R2_SECRET_ACCESS_KEY}" |
| 50 | + // Vercel team ID for Turborepo Remote Cache. TURBO_TEAMID |
| 51 | + // accepts the team_… form; use TURBO_TEAM if you'd rather |
| 52 | + // supply the slug. |
| 53 | + "TURBO_TEAMID": "team_ATZPkCXiYj2fRXGwHYQ1Zd27", |
| 54 | + // Headless asset hosting — Next inlines NEXT_PUBLIC_* vars |
| 55 | + // at build time, so this needs to be the build-time value. |
| 56 | + // The matching runtime value is set in `vars` above so the |
| 57 | + // container env passthrough has the same value. |
| 58 | + "NEXT_PUBLIC_ASSET_PREFIX": "https://assets.primalprinting.co.nz", |
| 59 | + // R2 assets bucket name. The matching access keys + S3 |
| 60 | + // endpoint live in the dashboard as Secrets. |
| 61 | + "R2_ASSETS_BUCKET": "primalprinting-assets" |
77 | 62 | } |
78 | 63 | } |
79 | 64 | ], |
|
0 commit comments