diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 59b1a6c..0d6cdfb 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -70,7 +70,10 @@ jobs: with: context: . push: true - platforms: linux/amd64,linux/arm64 + # arm64 temporarily disabled: it builds under QEMU emulation, which is slow + # and flaky for the heavy dependency tree. Re-enable by restoring: + # platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha,scope=${{ github.event.repository.name }}-docker diff --git a/Dockerfile b/Dockerfile index 0750ec7..e3e83d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,14 +10,20 @@ ENV YARN_CACHE_FOLDER=/usr/local/share/.cache/yarn/$TARGETARCH COPY package.json yarn.lock ./ COPY .npmrc* ./ +# --network-timeout: the arm64 leg builds under QEMU emulation where TLS/IO are +# slow enough that large tarballs (viem, @x402/paywall's wallet deps) blow past +# yarn's 30s default and fail with ESOCKETTIMEDOUT. RUN --mount=type=cache,target=/usr/local/share/.cache/yarn/$TARGETARCH,sharing=locked \ - corepack enable && yarn install --frozen-lockfile + corepack enable && yarn install --frozen-lockfile --network-timeout 600000 COPY . . RUN yarn build -# Remove devDependencies — native addons for production deps are already compiled -RUN yarn install --frozen-lockfile --production --ignore-scripts +# Remove devDependencies — native addons for production deps are already compiled. +# Same cache mount as the full install so this resolves from the warm cache +# instead of re-downloading everything over the network. +RUN --mount=type=cache,target=/usr/local/share/.cache/yarn/$TARGETARCH,sharing=locked \ + yarn install --frozen-lockfile --production --ignore-scripts --network-timeout 600000 # Production stage FROM node:22-slim