diff --git a/.codepress/dev-server/Dockerfile.web b/.codepress/dev-server/Dockerfile.web new file mode 100644 index 0000000..44bf12b --- /dev/null +++ b/.codepress/dev-server/Dockerfile.web @@ -0,0 +1,57 @@ +# 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. + +# Node 16 is the last release line linked against OpenSSL 1.1.1. This app's dev +# toolchain is react-scripts 1.0.10 / webpack 2.6.1, which hashes assets with +# md4 — removed in OpenSSL 3, so on Node 17+ the dev server dies immediately with +# `ERR_OSSL_EVP_UNSUPPORTED`. The FULL -bookworm variant (never -slim) is required +# because dependencies install at run time and need the node-gyp toolchain. +FROM public.ecr.aws/docker/library/node:16-bookworm + +# System packages the dev runtime needs. `procps` only — nothing in web/yarn.lock +# compiles a native module from source on linux/glibc (fsevents is darwin-only and +# is skipped), so no extra apt library is required. +RUN apt-get update \ + && apt-get install -y --no-install-recommends procps \ + && rm -rf /var/lib/apt/lists/* + +# web/package.json declares no `packageManager` field, and the node base image +# already ships the Yarn Classic binary this app's yarn.lock was written by — so +# the package manager is present without corepack (and without a cold-start +# registry download for a shim). No app dependency install happens here. + +WORKDIR /app + +# THIN image: no `node_modules`, no source COPY. The dev-server runtime provides +# dependencies at run time (squashfs hydration, or `yarn 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. +# `BROWSER=none` stops react-scripts from trying to launch a browser in the +# container. `DANGEROUSLY_DISABLE_HOST_CHECK` is needed because each preview is +# served from a freshly generated hostname that webpack-dev-server's Host +# allowlist cannot know in advance; it applies only to this CodePress dev image, +# never to `yarn start` on a developer's machine. +ENV HOSTNAME=0.0.0.0 \ + CODEPRESS_BIND_HOST=0.0.0.0 \ + PORT=3000 \ + CODEPRESS_HMR_CLIENT_PORT=443 \ + CODEPRESS_HMR_PROTOCOL=wss \ + BROWSER=none \ + DANGEROUSLY_DISABLE_HOST_CHECK=true + +WORKDIR /app/web +EXPOSE 3000 + +# Put the checkout's bins on PATH so anything the dev command shells out to +# resolves node_modules/.bin. These dirs are populated at run time on the +# bind-mounted checkout. Prepend, never replace ${PATH}. +ENV PATH="/app/web/node_modules/.bin:/app/node_modules/.bin:${PATH}" + +# Dev command (HMR on), invoked through the package manager rather than a bare +# binary. react-scripts reads HOST/PORT from env for its bind, and this CRA +# version's HMR client derives its websocket URL from the page origin — so it +# connects back through the preview proxy without any hardcoded host. +# WDS_SOCKET_PORT is exported for the uniform runtime contract (newer CRA reads it). +CMD ["sh", "-c", "BROWSER=none DANGEROUSLY_DISABLE_HOST_CHECK=true HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" PORT=\"${PORT:-3000}\" 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..58ab178 --- /dev/null +++ b/.codepress/dev-server/recipe.json @@ -0,0 +1,22 @@ +{ + "schema_version": 1, + "bootstrapped_at": "2026-07-25T09:49:45Z", + "discovery_branch": "codepress/dev@codepress.dev/bootstrap-live-dev-server-artifacts-b6322b18", + "frontends": [ + { + "label": "web", + "working_dir": "web", + "dockerfile_path": ".codepress/dev-server/Dockerfile.web", + "dev_command": "sh -c 'BROWSER=none DANGEROUSLY_DISABLE_HOST_CHECK=true HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" PORT=\"${PORT:-3000}\" WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" 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" + } + ] +}