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
58 changes: 58 additions & 0 deletions .codepress/dev-server/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 18 (FULL bookworm, never -slim): dependencies install at run time inside
# this image, so the node-gyp toolchain (make/gcc/g++/python3) has to be present.
# Nothing in the repo pins a Node version, and this frontend is a 2017-era
# create-react-app (react-scripts 1.0.10 / webpack 2.6.1), so 18 is the newest
# line that stack is comfortable on rather than the very latest LTS. webpack 2
# hashes with md5 (not md4), so no --openssl-legacy-provider workaround is needed.
FROM public.ecr.aws/docker/library/node:18-bookworm

# System packages the dev runtime needs. `procps` only: this app's dependency
# tree is pure JS (the single native module, fsevents, 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/*

# web/yarn.lock is a Yarn Classic (v1) lockfile and no `packageManager` field is
# declared, so pin Yarn 1 into the image — a cold start must never have to
# download a package manager before the dev command can run.
RUN corepack enable && corepack prepare yarn@1.22.22 --activate

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).

# HMR + bind config — values come from the runtime, never hardcoded.
ENV HOSTNAME=0.0.0.0 \
CODEPRESS_BIND_HOST=0.0.0.0 \
PORT=3000 \
CODEPRESS_HMR_CLIENT_PORT=443 \
CODEPRESS_HMR_PROTOCOL=wss

WORKDIR /app/web
EXPOSE 3000

# Workspace bins on PATH so the dev command — and anything it shells out to —
# resolves node_modules/.bin even when a binary is invoked directly. These dirs
# are populated at run time on the bind-mounted checkout. Prepend, never replace
# ${PATH}, so the corepack/yarn shims survive.
ENV PATH="/app/web/node_modules/.bin:/app/node_modules/.bin:${PATH}"

# Dev command (HMR on): `react-scripts start` via the package script.
# HOST/PORT — create-react-app's bind contract, fed from the runtime env.
# BROWSER=none — nothing to open inside a container.
# WDS_SOCKET_PORT — public HMR port behind the preview proxy. react-scripts
# 1.x derives the sockjs URL from window.location (so HMR
# already works over wss:443 through the proxy) and ignores
# this; it is set for the uniform runtime contract and for
# the day this app is upgraded.
# DANGEROUSLY_DISABLE_HOST_CHECK — webpack-dev-server 2's DNS-rebinding host check
# otherwise rejects the preview hostname with "Invalid Host
# header". react-scripts 1.0.10 supports this flag.
CMD ["sh", "-c", "HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" PORT=\"${PORT:-3000}\" BROWSER=none WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" DANGEROUSLY_DISABLE_HOST_CHECK=true 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:53:00Z",
"discovery_branch": "codepress/dev@codepress.dev/bootstrap-live-dev-server-artifacts-866d779c",
"frontends": [
{
"label": "web",
"working_dir": "web",
"dockerfile_path": ".codepress/dev-server/Dockerfile.web",
"dev_command": "sh -c 'HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" PORT=\"${PORT:-3000}\" BROWSER=none WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" DANGEROUSLY_DISABLE_HOST_CHECK=true 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"
}
]
}