Theme
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
- NitHost downloads an immutable archive for the exact commit SHA from GitHub
- Builds happen while the existing runtime stays online
- The managed application container switches only after a successful build
- Candidate must pass the configured HTTP health check
- If activation fails → restore previous Git release (or original manual runtime on first deploy)
- 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
| Item | Recommendation |
|---|---|
| Lockfile | Commit package-lock.json — uses npm ci when present |
| Build command | Blank = install dependencies (including dev), then npm run build --if-present |
| Engines | package.json engines, .nvmrc, .node-version, .nithost/node-version |
| Start | npm start / node … listening on proxy port |
| Health | e.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
| Item | Requirement |
|---|---|
| Manifest | requirements.txt, requirements-prod.txt, or pyproject.toml (or under backend/) |
| Venv | Created per release with the site’s Python version (3.10–3.14) |
| Default start | uvicorn server:app --host 0.0.0.0 --port 8000 |
| Proxy port | Usually 8000 |
| Health | Non-5xx without auth |
| Frontend build | Optional Frontend asset build command runs in Node before venv create |
| Runtime FS | Read-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/healthBranch protection
Protect main and require CI. Auto-deploy ships whatever GitHub accepts on the branch.