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
56 changes: 56 additions & 0 deletions .codepress/dev-server/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -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"]
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-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"
}
]
}