Docs/Getting Started/Deployment

Getting Started

Deployment

Deployment — Getting Started documentation for BCP Framework.

Last updated: 2026-08-29T17:13:55

Deployment

Build

Bash
npm run build

BCP writes the raw production artifact to .bcp-framework/build.

text
.bcp-framework/build/
├─ client/
├─ public/
├─ manifest.json
└─ server/
   ├─ server.mjs
   ├─ middleware.mjs
   ├─ cache-manifest.json
   └─ config.json

Use 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:

Bash
bcp package

or from the framework repository/example script surface:

Bash
npm run package

bcp package runs a fresh production build and creates:

text
.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.md

The package manifest excludes development dependencies. With a safely pruned npm v3 lockfile, install runtime dependencies with:

Bash
npm ci --omit=dev

If 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:

Bash
npm start

or:

Bash
node .bcp-framework/build/server/server.mjs

Inside .bcp-framework/package, after production dependencies are installed:

Bash
npm start

which runs:

Bash
node server/server.mjs

Runtime server overrides

The build retains the configured server defaults. Deployment can override the public bind address with supported runtime variables:

text
BCP_PORT
BCP_HOSTNAME

The CLI also supports the raw build runtime flow:

Bash
bcp start --port 8080 --hostname 0.0.0.0

For a packaged application, provide BCP_PORT and BCP_HOSTNAME through the runtime environment.

Containers

bcp package generates a starter Dockerfile in .bcp-framework/package.

Bash
cd .bcp-framework/package
docker build -t my-bcp-app .
docker run --rm -p 3000:3000 my-bcp-app

Pass 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:

Bash
npm run typecheck
npm test
bcp package

Then validate the deployment package:

Bash
cd .bcp-framework/package
npm ci --omit=dev
npm start

If bcp.package.json reports lockfile: false, use its recorded install command instead of npm ci.

For framework releases themselves, use:

Bash
npm run rc:check