From 7a944e85d784af3fa7f2a9db3df6d9ae03d9efe6 Mon Sep 17 00:00:00 2001 From: "codepress-dev[bot]" <202219725+codepress-dev[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 06:20:17 +0000 Subject: [PATCH] Bootstrap CodePress Live Dev Server recipe + dev Dockerfiles --- .codepress/dev-server/Dockerfile.web | 37 ++++++++++++++++++++++++++++ .codepress/dev-server/recipe.json | 18 ++++++++++++++ 2 files changed, 55 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..036187e --- /dev/null +++ b/.codepress/dev-server/Dockerfile.web @@ -0,0 +1,37 @@ +# 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-slim + +# No extra system packages needed for this frontend. +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +RUN corepack enable + +WORKDIR /app + +# THIN image: no `node_modules`, no source COPY. The dev-server runtime provides +# dependencies at run time (squashfs hydration, or `yarn install` in this image +# against the bind-mounted checkout). Only the toolchain lives here. + +# HMR + bind config — values come from the runtime, never hardcoded. +# CRA reads HOST (bind address) and WDS_SOCKET_PORT (HMR websocket public port). +ENV HOSTNAME=0.0.0.0 \ + HOST=0.0.0.0 \ + PORT=3000 \ + CODEPRESS_HMR_CLIENT_PORT=443 \ + CODEPRESS_HMR_PROTOCOL=wss + +WORKDIR /app/web +EXPOSE 3000 + +# Put workspace bins on PATH so the dev command resolves node_modules/.bin +# at runtime (hydration / runtime install populates these). +ENV PATH="/app/web/node_modules/.bin:/app/node_modules/.bin:${PATH}" + +# CRA: wrap start with WDS_SOCKET_PORT so the webpack-dev-server HMR client +# connects to the public (proxied) port, not the container-internal port. +CMD ["sh", "-c", "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..fc6412d --- /dev/null +++ b/.codepress/dev-server/recipe.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "bootstrapped_at": "2026-06-24T06:18:00Z", + "discovery_branch": "master", + "frontends": [ + { + "label": "web", + "working_dir": "web", + "dockerfile_path": ".codepress/dev-server/Dockerfile.web", + "dev_command": "yarn start", + "framework": "cra", + "package_manager": "yarn", + "dev_port": 3000, + "system_packages": [], + "size": "small" + } + ] +}