From ea65ec0c310a0debf752641a13b0f6767576bb69 Mon Sep 17 00:00:00 2001 From: "codepress-dev[bot]" <202219725+codepress-dev[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 04:24:30 +0000 Subject: [PATCH] Bootstrap CodePress Live Dev Server recipe + dev Dockerfiles --- .codepress/dev-server/Dockerfile.web | 56 ++++++++++++++++++++++++++++ .codepress/dev-server/recipe.json | 22 +++++++++++ 2 files changed, 78 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..9c373b8 --- /dev/null +++ b/.codepress/dev-server/Dockerfile.web @@ -0,0 +1,56 @@ +# 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. + +# Create React App (react-scripts 1.0.10 / React 15) is a 2017-era toolchain +# built on webpack 2. Its build hashing breaks on Node 17+ with OpenSSL 3 +# ("error:0308010C:digital envelope routines::unsupported"), so pin Node 18 +# (a real -bookworm image carrying the node-gyp toolchain) and re-enable the +# legacy OpenSSL provider so the dev server actually boots. There is no Node +# version pin in the repo to match. +FROM public.ecr.aws/docker/library/node:18-bookworm + +# System packages the dev runtime needs. `procps` only: this app's dependencies +# are pure JS (react, redux, aphrodite, react-scripts), so no native module +# compiles and no extra apt library is required. +RUN apt-get update \ + && apt-get install -y --no-install-recommends procps \ + && 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. +# HOST CRA's bind address (alias of the container bind host). +# DANGEROUSLY_DISABLE_HOST_CHECK accept the preview proxy's Host header +# (the CRA equivalent of Vite's allowedHosts) — without +# it the preview gets "Invalid Host header". +# BROWSER=none never try to launch a browser inside the container. +# NODE_OPTIONS legacy OpenSSL provider for webpack 2 on Node 18. +ENV HOSTNAME=0.0.0.0 \ + CODEPRESS_BIND_HOST=0.0.0.0 \ + HOST=0.0.0.0 \ + PORT=3000 \ + CODEPRESS_HMR_CLIENT_PORT=443 \ + CODEPRESS_HMR_PROTOCOL=wss \ + DANGEROUSLY_DISABLE_HOST_CHECK=true \ + BROWSER=none \ + NODE_OPTIONS=--openssl-legacy-provider + +WORKDIR /app/web +EXPOSE 3000 + +# Put the app + root node_modules bins on PATH so react-scripts resolves at +# runtime even if invoked directly. These dirs are populated at run time on the +# bind-mounted checkout (hydration / runtime install). +ENV PATH="/app/web/node_modules/.bin:/app/node_modules/.bin:${PATH}" + +# Dev command (HMR on) via the package manager, never a bare binary. CRA reads +# HOST/PORT for bind and WDS_SOCKET_PORT for the webpack-dev-server HMR client +# socket, so map the public HMR client port from the runtime env. `yarn start` +# runs the package's `start` script (`react-scripts start`). +CMD ["sh", "-c", "HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" yarn start"] diff --git a/.codepress/dev-server/recipe.json b/.codepress/dev-server/recipe.json new file mode 100644 index 0000000..81e94db --- /dev/null +++ b/.codepress/dev-server/recipe.json @@ -0,0 +1,22 @@ +{ + "schema_version": 1, + "bootstrapped_at": "2026-07-18T04:23:28Z", + "discovery_branch": "codepress/codepress/bootstrap-live-dev-server-artifacts-cafc6d94", + "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" + } + ] +}