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
59 changes: 59 additions & 0 deletions .codepress/dev-server/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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.
FROM public.ecr.aws/docker/library/node:22-bookworm

# System packages the dev runtime needs. `procps` only: this app's dependency tree
# has no native module that builds from source on linux (its only node-gyp package,
# `fsevents`, is darwin-only and is skipped here), 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/*

# The repo declares no `packageManager` field and ships a v1 `web/yarn.lock`, so
# pin Yarn Classic explicitly. Baking the binary keeps cold starts from having to
# fetch a package manager off the public registry 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). Only the toolchain lives here.

# 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

# react-scripts otherwise tries to launch a browser on start; there is none here.
ENV BROWSER=none

# This app pins react-scripts 1.0.10, whose dev server disables webpack-dev-server's
# host check unless a `proxy` field is set in package.json. None is set today, so the
# preview host is already accepted; setting this keeps the preview working if a
# `proxy` is added later.
ENV DANGEROUSLY_DISABLE_HOST_CHECK=true

WORKDIR /app/web
EXPOSE 3000

# Put the app + root 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}, so the corepack/yarn shims survive.
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 bin.
# react-scripts reads the bind address from HOST (not HOSTNAME), so map
# CODEPRESS_BIND_HOST onto it at run time — that way a runtime override is honored
# instead of being frozen into an ENV at build time.
#
# WDS_SOCKET_PORT is mapped for contract uniformity, but note it is a no-op on
# react-scripts 1.x: that version's HMR client (react-dev-utils 3.x
# webpackHotDevClient) builds its SockJS URL from window.location, so behind the
# preview proxy it already connects to wss://<preview-host>/sockjs-node on 443.
# The mapping takes effect as written if react-scripts is later upgraded to 3.4+.
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-26T20:43:15Z",
"discovery_branch": "master",
"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": "small"
}
]
}