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
61 changes: 61 additions & 0 deletions .codepress/dev-server/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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 rather than the current LTS is deliberate. This app is Create React
# App 1.0.10 on webpack 2.6.1, a pipeline that predates OpenSSL 3 and relies on
# md4 hashing; it runs on Node 18 with --openssl-legacy-provider (set below),
# and newer Node majors have dropped that escape hatch.
FROM public.ecr.aws/docker/library/node:18-bookworm

# System packages the dev runtime needs. `procps` only: this app builds no
# native module from source (its one native dep, fsevents, is optional and
# darwin-only, so it is skipped on linux). The node-gyp toolchain
# (make/gcc/g++/python3) comes from the full -bookworm base.
RUN apt-get update \
&& apt-get install -y --no-install-recommends procps \
&& rm -rf /var/lib/apt/lists/*

# Bake the package manager so a cold start never has to fetch it. web/yarn.lock
# is a Yarn v1 lockfile and the repo declares no `packageManager`, so pin Yarn
# Classic explicitly. This bakes only the yarn binary, not app dependencies.
RUN corepack enable && corepack prepare yarn@1.22.22 --activate

WORKDIR /app

# THIN image: no `node_modules` and no source COPY. The dev-server runtime
# provides dependencies at run time against the bind-mounted checkout at /app
# (squashfs hydration, or `yarn install --frozen-lockfile` in this image).

# HMR + bind config. Values come from the runtime; nothing here is hardcoded to
# localhost. BROWSER=none stops react-scripts from trying to open a browser in
# the container, and DANGEROUSLY_DISABLE_HOST_CHECK lets webpack-dev-server
# answer requests addressed to the preview hostname instead of rejecting them
# with "Invalid Host header" (the CRA equivalent of Vite's allowedHosts).
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 \
CODEPRESS_BASE_PATH=/ \
BROWSER=none \
DANGEROUSLY_DISABLE_HOST_CHECK=true \
NODE_OPTIONS=--openssl-legacy-provider

WORKDIR /app/web
EXPOSE 3000

# Put the app's bins on PATH so the dev command — and anything it shells out to
# — resolves node_modules/.bin. These dirs are populated at run time on the
# bind-mounted checkout. Prepend, never replace, 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` reads HOST and PORT from env, so
# bind is covered by the runtime contract. This CRA version's HMR client
# (react-dev-utils 3) opens its sockjs connection against the page's own origin,
# so it works through the preview proxy without a client-port flag once
# websocket upgrades are forwarded; WDS_SOCKET_PORT is mapped anyway to keep the
# runtime contract uniform and to stay correct if CRA is ever 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-25T19:11:56Z",
"discovery_branch": "codepress/dev@codepress.dev/bootstrap-live-dev-server-artifacts-eeb2df86",
"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}\" WDS_SOCKET_PORT=\"${CODEPRESS_HMR_CLIENT_PORT:-443}\" 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"
}
]
}