Getting Started
Deployment
Deployment — Getting Started documentation for BCP Framework.
Last updated: 2026-08-29T17:13:55
Deployment
Build
npm run buildBCP writes the raw production artifact to .bcp-framework/build.
.bcp-framework/build/
├─ client/
├─ public/
├─ manifest.json
└─ server/
├─ server.mjs
├─ middleware.mjs
├─ cache-manifest.json
└─ config.jsonUse the build directory when the deployment system already manages the application's production dependencies and artifact layout.
Application package — 0.2.4
For a deployment-oriented directory, run:
bcp packageor from the framework repository/example script surface:
npm run packagebcp package runs a fresh production build and creates:
.bcp-framework/package/
├─ client/
├─ server/
│ └─ server.mjs
├─ public/ # when present
├─ manifest.json
├─ package.json
├─ package-lock.json # when a safe production lock can be derived
├─ bcp.package.json
├─ bcp.deployment.json
├─ bcp.env.json
├─ Dockerfile
├─ .dockerignore
└─ README.mdThe package manifest excludes development dependencies. With a safely pruned npm v3 lockfile, install runtime dependencies with:
npm ci --omit=devIf no package lock is included, follow the install command recorded in bcp.package.json/bcp.deployment.json.
BCP does not copy .env files into the package. Provide environment values and secrets at deployment/runtime.
See Application Packaging for the full packaging contract.
Start
For the raw build:
npm startor:
node .bcp-framework/build/server/server.mjsInside .bcp-framework/package, after production dependencies are installed:
npm startwhich runs:
node server/server.mjsRuntime server overrides
The build retains the configured server defaults. Deployment can override the public bind address with supported runtime variables:
BCP_PORT
BCP_HOSTNAMEThe CLI also supports the raw build runtime flow:
bcp start --port 8080 --hostname 0.0.0.0For a packaged application, provide BCP_PORT and BCP_HOSTNAME through the runtime environment.
Containers
bcp package generates a starter Dockerfile in .bcp-framework/package.
cd .bcp-framework/package
docker build -t my-bcp-app .
docker run --rm -p 3000:3000 my-bcp-appPass credentials and environment-specific settings through the container/orchestrator environment rather than baking them into the image.
If you deploy the raw .bcp-framework/build directory instead, the image must separately include the runtime dependencies required by the generated server bundle, including React/React DOM when they remain external to the bundle.
Reverse proxies
BCP can run behind a reverse proxy or tunnel. Forward the original host correctly when application middleware or absolute URL construction depends on host information.
Only enable trusted-proxy handling when the application process is actually isolated behind a trusted proxy/load balancer.
Multiple instances
The current response/data cache is process-local. If multiple containers or Node.js processes serve the application, each maintains independent cache entries and invalidation state.
Production verification
Before deployment:
npm run typecheck
npm test
bcp packageThen validate the deployment package:
cd .bcp-framework/package
npm ci --omit=dev
npm startIf bcp.package.json reports lockfile: false, use its recorded install command instead of npm ci.
For framework releases themselves, use:
npm run rc:check