Skip to content

Node.js & Python contracts

How NitHost builds and releases source deployments. Satisfy these contracts for reliable auto-deploy.

Who can use this page? Site managers and developers deploying Node or Python sites.

Shared release behavior

  1. NitHost downloads an immutable archive for the exact commit SHA from GitHub
  2. Builds happen while the existing runtime stays online
  3. The managed application container switches only after a successful build
  4. Candidate must pass the configured HTTP health check
  5. If activation fails → restore previous Git release (or original manual runtime on first deploy)
  6. Recent successful releases remain for rollback according to your service’s retention policy

Sensitive site variables are runtime-only. Only non-sensitive variables explicitly marked available at build time enter builds.

Node.js

ItemRecommendation
LockfileCommit package-lock.json — uses npm ci when present
Build commandBlank = install dependencies (including dev), then npm run build --if-present
Enginespackage.json engines, .nvmrc, .node-version, .nithost/node-version
Startnpm start / node … listening on proxy port
Healthe.g. /api/health

The default skips an absent build script but fails if an existing build script fails. To use an explicit install-only build command, set npm ci --include=dev with a current lockfile. For manual uploads, see the upload-and-start workflow.

New sites default to Node 24 LTS or 22 LTS.

Python

ItemRequirement
Manifestrequirements.txt, requirements-prod.txt, or pyproject.toml (or under backend/)
VenvCreated per release with the site’s Python version (3.10–3.14)
Default startuvicorn server:app --host 0.0.0.0 --port 8000
Proxy portUsually 8000
HealthNon-5xx without auth
Frontend buildOptional Frontend asset build command runs in Node before venv create
Runtime FSRead-only — use Mongo/GridFS, object storage, or managed persistent services for uploads

Example monorepo

text
Application root: .
Frontend asset build: cd frontend && npm ci && npm run build
Start command: uvicorn backend.server:app --host 0.0.0.0 --port 8000
Health check: /api/health

Branch protection

Protect main and require CI. Auto-deploy ships whatever GitHub accepts on the branch.

Customer documentation · Nusite IT Consulting Limited