From dd829aed2ba5d63e811c26b5a8f97b6ecd19b1eb Mon Sep 17 00:00:00 2001 From: kimo-ice <162329697+kimo-ice@users.noreply.github.com> Date: Fri, 17 Apr 2026 13:08:54 +0200 Subject: [PATCH] feat(web): add Dockerfile and GKE release workflow for landing page Enable standalone output in Next.js config, add Dockerfile.web for containerized deployment, and extend gke-release.yml to build/push the web image alongside API and bundler. --- .github/workflows/gke-release.yml | 10 ++++++++++ Dockerfile.web | 24 ++++++++++++++++++++++++ packages/web/next.config.ts | 4 +++- packages/web/public/.gitkeep | 0 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.web create mode 100644 packages/web/public/.gitkeep diff --git a/.github/workflows/gke-release.yml b/.github/workflows/gke-release.yml index 39825f9..4e26eb8 100644 --- a/.github/workflows/gke-release.yml +++ b/.github/workflows/gke-release.yml @@ -108,3 +108,13 @@ jobs: tags: | ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/bundler:${{ steps.tag.outputs.version }} ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/bundler:latest + + - name: Build and push web image + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.web + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/web:${{ steps.tag.outputs.version }} + ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/web:latest diff --git a/Dockerfile.web b/Dockerfile.web new file mode 100644 index 0000000..4f0ada3 --- /dev/null +++ b/Dockerfile.web @@ -0,0 +1,24 @@ +FROM node:22-slim AS base +RUN corepack enable && corepack prepare pnpm@10.32.1 --activate +WORKDIR /app + +FROM base AS deps +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY packages/web/package.json packages/web/ +RUN pnpm install --frozen-lockfile --filter @agent-paymaster/web + +FROM base AS build +COPY --from=deps /app ./ +COPY packages/web packages/web +RUN pnpm --filter @agent-paymaster/web build + +FROM node:22-slim AS runtime +WORKDIR /app +COPY --from=build /app/packages/web/.next/standalone ./ +COPY --from=build /app/packages/web/.next/static ./packages/web/.next/static +COPY --from=build /app/packages/web/public ./packages/web/public +USER node +EXPOSE 3000 +ENV PORT=3000 HOSTNAME="0.0.0.0" NODE_ENV=production +HEALTHCHECK --interval=30s --timeout=5s CMD node -e "fetch('http://localhost:3000').then((r) => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))" +CMD ["node", "packages/web/server.js"] diff --git a/packages/web/next.config.ts b/packages/web/next.config.ts index cb651cd..68a6c64 100644 --- a/packages/web/next.config.ts +++ b/packages/web/next.config.ts @@ -1,5 +1,7 @@ import type { NextConfig } from "next"; -const nextConfig: NextConfig = {}; +const nextConfig: NextConfig = { + output: "standalone", +}; export default nextConfig; diff --git a/packages/web/public/.gitkeep b/packages/web/public/.gitkeep new file mode 100644 index 0000000..e69de29