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 16 is pinned deliberately. This app is Create React App 1.0.10 on
# webpack 2.6.1 / webpack-dev-server 2.5.0 / React 15 (see web/yarn.lock), a
# 2017-era toolchain that does not run on current Node majors. The repo pins no
# Node version of its own (no .nvmrc, no engines.node), so the current-LTS
# default would produce an image whose dev server never boots.
FROM public.ecr.aws/docker/library/node:16-bookworm

# System packages the dev runtime needs. `procps` only, so dev-process
# supervisors can inspect and clean up child process trees on shutdown. This
# app's dependency tree has no native module that builds from source on linux
# (fsevents@1.1.2 is darwin-only and skipped), so no extra apt library applies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends procps \
&& rm -rf /var/lib/apt/lists/*

# yarn 1.x classic drives this app (web/yarn.lock is a v1 lockfile, and the repo
# declares no `packageManager` field). The node:16-bookworm base already ships
# yarn 1.22.x, so assert it at build time — the build then fails loudly instead
# of the dev command failing at run time — and fall back to a pinned install if a
# future base image drops it. Only the package-manager binary is baked here,
# never app dependencies.
RUN yarn --version || npm install --global --force yarn@1.22.22

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

WORKDIR /app/web
EXPOSE 3000

# Put the app and root bins on PATH as a backstop, so the dev command and
# anything it shells out to resolve node_modules/.bin. Both 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) — `react-scripts start`, routed through yarn rather than a
# bare bin. CRA reads HOST and PORT from env, so the bind address stays
# runtime-driven and never hardcodes localhost. WDS_SOCKET_PORT carries the
# PUBLIC HMR port for react-scripts versions that honor it; this version's
# react-dev-utils derives the sockjs URL from window.location, which already
# resolves to the preview origin behind the proxy. BROWSER=none stops CRA trying
# to launch a browser inside the container, and DANGEROUSLY_DISABLE_HOST_CHECK
# keeps webpack-dev-server from rejecting the preview's Host header.
CMD ["sh", "-c", "HOST=\"${CODEPRESS_BIND_HOST:-0.0.0.0}\" PORT=\"${PORT:-3000}\" WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" BROWSER=none 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-27T16:05:25Z",
"discovery_branch": "codepress/dev@codepress.dev/bootstrap-live-dev-server-artifacts-6561aa70",
"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}\" WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" BROWSER=none 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"
}
]
}