From 2a49d0689b33af47a7ade98ccc1cc14321bcb091 Mon Sep 17 00:00:00 2001 From: "codepress-dev[bot]" <202219725+codepress-dev[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 21:22:25 +0000 Subject: [PATCH] Bootstrap CodePress Live Dev Server recipe + dev Dockerfiles Co-authored-by: dev@codepress.dev --- .codepress/dev-server/Dockerfile.web | 45 ++++++++++++++++++++++++++++ .codepress/dev-server/recipe.json | 22 ++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .codepress/dev-server/Dockerfile.web create mode 100644 .codepress/dev-server/recipe.json diff --git a/.codepress/dev-server/Dockerfile.web b/.codepress/dev-server/Dockerfile.web new file mode 100644 index 0000000..276dca3 --- /dev/null +++ b/.codepress/dev-server/Dockerfile.web @@ -0,0 +1,45 @@ +# Generated by CodePress bootstrap-dev-server. +# Dev-mode image for the "web" frontend (Live Dev Server). +# Edits are preserved, but running /codepress-bootstrap-dev-server again may overwrite them. +FROM public.ecr.aws/docker/library/node:22-bookworm + +# System packages the dev runtime needs. `procps` only: this app's dependencies +# (Next.js, React, Radix, Tailwind) ship prebuilt binaries with no source-built +# native module, so no extra apt library is required — add one here only for a +# source-built native module (see the dockerfile contract). +RUN apt-get update \ + && apt-get install -y --no-install-recommends procps \ + && rm -rf /var/lib/apt/lists/* + +# Enable corepack and pre-activate pnpm (repo has no `packageManager` field; +# pin pnpm 9 to match pnpm-lock.yaml's `lockfileVersion: '9.0'`). This bakes only +# the package-manager shim, not app dependencies, so MicroVM cold starts don't +# fetch pnpm from the registry before the dev command runs. +RUN corepack enable && corepack prepare pnpm@9.15.0 --activate + +WORKDIR /app + +# THIN image: no `node_modules`, no source COPY. The dev-server runtime provides +# dependencies at run time (squashfs hydration, or `pnpm install --frozen-lockfile` +# in this image against the bind-mounted checkout). Only the toolchain lives here. + +# HMR + bind config — values come from the runtime, never hardcoded. next dev +# honors HOSTNAME and PORT directly, and its HMR websocket rides the page origin, +# so the CODEPRESS_HMR_* vars are declared for the uniform runtime/proxy contract. +ENV HOSTNAME=0.0.0.0 \ + CODEPRESS_BIND_HOST=0.0.0.0 \ + PORT=3000 \ + CODEPRESS_HMR_CLIENT_PORT=443 \ + CODEPRESS_HMR_PROTOCOL=wss + +EXPOSE 3000 + +# Put the root node_modules bins on PATH so the dev command — and anything it +# shells out to — resolves node_modules/.bin. Populated at run time on the +# bind-mounted checkout. Prepend, never replace ${PATH}, so the corepack/pnpm +# shims survive. +ENV PATH="/app/node_modules/.bin:${PATH}" + +# Dev command (HMR on). `next dev` honors HOSTNAME and PORT from env. Invoke via +# the package manager, not a bare bin. +CMD ["pnpm", "dev"] diff --git a/.codepress/dev-server/recipe.json b/.codepress/dev-server/recipe.json new file mode 100644 index 0000000..a28b7ed --- /dev/null +++ b/.codepress/dev-server/recipe.json @@ -0,0 +1,22 @@ +{ + "schema_version": 1, + "bootstrapped_at": "2026-07-23T21:18:00Z", + "discovery_branch": "main", + "frontends": [ + { + "label": "web", + "working_dir": "", + "dockerfile_path": ".codepress/dev-server/Dockerfile.web", + "dev_command": "pnpm dev", + "prebuild_command": "", + "prebuild_inputs": [], + "framework": "next", + "package_manager": "pnpm", + "install_command": "pnpm install --frozen-lockfile", + "dependency_manifests": ["pnpm-lock.yaml"], + "dev_port": 3000, + "system_packages": ["procps"], + "size": "medium" + } + ] +}