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
68 changes: 68 additions & 0 deletions .codepress/dev-server/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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 rather than the current LTS is deliberate. web/package.json pins
# react-scripts 1.0.10, which resolves (per web/yarn.lock) to webpack 2.6.1 —
# and webpack 2/3 hash modules with md4. OpenSSL 3, bundled from Node 17 on,
# removed md4, so a newer base dies on the first build with
# `error:0308010C:digital envelope routines::unsupported`. Node 16 ships
# OpenSSL 1.1.1, so this dev server starts without patching the app.
# The FULL -bookworm variant (never -slim) supplies the node-gyp toolchain
# (make/gcc/g++/python3) that the runtime dependency install may need.
FROM public.ecr.aws/docker/library/node:16-bookworm

# System packages the dev runtime needs. `procps` only: this app has no
# source-built native module — its single native dependency, fsevents@1.1.2, is
# darwin-only and is skipped on linux — 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/*

# Yarn 1.x ships preinstalled in the node:16 base, which is exactly the package
# manager web/yarn.lock was written by. Corepack is deliberately NOT enabled:
# this repo declares no `packageManager` field, so a corepack shim would shadow
# the working bundled yarn and try to fetch a package manager from the public
# registry on every cold start. Assert yarn is present so a base-image change
# fails loudly here at build time instead of mysteriously at dev-command time.
RUN yarn --version

WORKDIR /app

# THIN image: no node_modules and 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.
# HOST is CRA's own bind variable (react-scripts reads HOST, not HOSTNAME).
# BROWSER=none stops react-scripts trying to open a browser in the container.
# DANGEROUSLY_DISABLE_HOST_CHECK lets webpack-dev-server accept the preview's
# proxied Host header; without it a *.preview.codepress.dev request can be
# rejected with "Invalid Host header". Dev-only image, never a production build.
ENV HOSTNAME=0.0.0.0 \
HOST=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. Populated at run time on the bind-mounted checkout
# (hydration / runtime install). Prepend, never replace ${PATH}, so the base
# image's yarn stays reachable.
ENV PATH="/app/web/node_modules/.bin:/app/node_modules/.bin:${PATH}"

# Dev command (HMR on) — react-scripts start via the package manager, never a
# bare bin. HOST/PORT come from the env contract above.
# WDS_SOCKET_PORT is mapped from CODEPRESS_HMR_CLIENT_PORT per the runtime
# contract. Note: this pinned react-dev-utils (3.0.2) builds its HMR socket URL
# from window.location, so HMR already follows the public preview origin the way
# Next.js does, and needs no client-port flag; WDS_SOCKET_PORT is only honored by
# react-scripts >= 3.4 and is passed here for forward compatibility if the app
# is upgraded.
CMD ["sh", "-c", "HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" yarn start"]
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-26T01:48:15Z",
"discovery_branch": "codepress/dev@codepress.dev/bootstrap-dev-server-artifacts-c706f8e3",
"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"
}
]
}