From da27136aa5d79de417c5cfef1ba82cb9582671b5 Mon Sep 17 00:00:00 2001 From: "codepress-dev[bot]" <202219725+codepress-dev[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 18:36:40 +0000 Subject: [PATCH] Bootstrap CodePress Live Dev Server recipe + dev Dockerfiles --- .codepress/dev-server/Dockerfile.web | 33 ++++++++++++++++++++++++++++ .codepress/dev-server/recipe.json | 26 ++++++++++++++++++++++ 2 files changed, 59 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..0b1377d --- /dev/null +++ b/.codepress/dev-server/Dockerfile.web @@ -0,0 +1,33 @@ +# 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` supports clean shutdown of +# process supervisors used by direct MicroVM dev commands. +RUN apt-get update \ + && apt-get install -y --no-install-recommends procps \ + && rm -rf /var/lib/apt/lists/* + +RUN corepack enable + +# THIN image: no node_modules and no source COPY. The dev-server runtime mounts +# the checkout and provides dependencies before this command starts. +WORKDIR /app + +# HMR + bind config — values come from the runtime, never hardcoded. +ENV HOSTNAME=0.0.0.0 \ + CODEPRESS_BIND_HOST=0.0.0.0 \ + PORT=3000 \ + CODEPRESS_HMR_CLIENT_PORT=443 \ + CODEPRESS_HMR_PROTOCOL=wss + +WORKDIR /app/web +EXPOSE 3000 + +# Runtime-installed dependencies live in this directory on the mounted checkout. +ENV PATH="/app/web/node_modules/.bin:/app/node_modules/.bin:${PATH}" + +# CRA reads HOST, PORT, and WDS_SOCKET_PORT. The wrapper maps the Live Dev +# Server's public HMR port while preserving the package script as the dev command. +CMD ["sh", "-c", "HOST=\"$CODEPRESS_BIND_HOST\" WDS_SOCKET_PORT=\"$CODEPRESS_HMR_CLIENT_PORT\" yarn start"] diff --git a/.codepress/dev-server/recipe.json b/.codepress/dev-server/recipe.json new file mode 100644 index 0000000..36ed59a --- /dev/null +++ b/.codepress/dev-server/recipe.json @@ -0,0 +1,26 @@ +{ + "schema_version": 1, + "bootstrapped_at": "2026-07-27T00:00:00Z", + "discovery_branch": "codepress/dev@codepress.dev/bootstrap-django-react-dev-server-2a38b448", + "frontends": [ + { + "label": "web", + "working_dir": "web", + "dockerfile_path": ".codepress/dev-server/Dockerfile.web", + "dev_command": "yarn start", + "prebuild_command": "", + "prebuild_inputs": [], + "framework": "cra", + "package_manager": "yarn", + "install_command": "yarn install --frozen-lockfile", + "dependency_manifests": [ + "web/yarn.lock" + ], + "dev_port": 3000, + "system_packages": [ + "procps" + ], + "size": "medium" + } + ] +}