Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .codepress/dev-server/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -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"]
22 changes: 22 additions & 0 deletions .codepress/dev-server/recipe.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}