Deploying
Build settings: build, start, root folder and more
Every DployHub build setting explained: build type, build and start commands, port, root folder, Dockerfile path and health check path, with examples.
Updated 3 min read
DployHub detects how to build and run most projects on its own, but every detected value can be changed. You set these fields when creating an app under How to build it, and you can edit them any time in the app Settings. This page explains what each one does and when to change it.
Build type
- Figure it out for me: we check the root folder for a
Dockerfile, thenpackage.json, then Python files, thenindex.html, and use the first match. - Use my Dockerfile: always build with your Dockerfile. See Deploy with your own Dockerfile.
- Node.js: build on node:20-alpine with your package manager. See Deploy a Node.js app.
- Python: build on python:3.12-slim. See Deploy a Python app.
- Static website: serve files with gzip and SPA fallback. See Deploy a static site.
The fields
Build command (optional)
Runs after dependencies are installed. Leave it empty to use the detected one, such as npm run build, or set your own, for example npm run build:prod or python manage.py collectstatic --noinput.
Start command (optional)
The command that runs your app in the container. Examples: node dist/server.js, npm run start:prod, gunicorn mysite.wsgi --bind 0.0.0.0:8000, uvicorn app.main:app --host 0.0.0.0 --port 8000.
Port your app listens on
The port we send traffic to and check during releases. We also set the PORT environment variable to this value unless you set PORT yourself. See Port and health checks.
Folder with your app
The root folder for detection and the build, for monorepos or projects in a subfolder. For example apps/web or services/api. Leave it empty to use the repository root.
Dockerfile path
Used when building with a Dockerfile. Defaults to Dockerfile, relative to the root folder, for example docker/Dockerfile.prod.
Health check path
The path we request to decide that a new version is ready. Defaults to / and must start with /, for example /health or /api/status.
Example: a monorepo API
How to build it: Node.js
Folder with app: services/api
Build command: pnpm build
Start command: node dist/main.js
Port: 4000
Health check path: /healthWhen changes take effect
Build settings are used on the next deploy. Press Deploy to build with the new settings; the result goes to staging, and Go live promotes it. Resource changes are different: they apply to live straight away with a quick restart and no rebuild. See Resources.
Limits to know
- Cloning has a 5-minute timeout and builds have a 30-minute timeout.
- Build logs stream live in the Deployments tab for every deploy.
- We keep the last 5 built images per app for rollback.
If detection picks the wrong thing and overriding does not help, raise a ticket and attach the deployment so we can see the build log.
Frequently asked questions
Do I have to fill in the build and start commands?
No. Both are optional. Leave them empty to use what we detect.
How do I deploy an app from a subfolder?
Set Folder with your app to the subfolder path, for example apps/web. Detection and the build run from there.
When do changed build settings apply?
On the next deploy. Press Deploy, check staging, then press Go live.
Related articles
- Deploy a Node.js app (Express, Fastify, NestJS)How DployHub detects and deploys Node.js apps: package manager, build and start commands, port detection and the settings you can override.
- Deploy a Python app (Django, FastAPI, Flask)How DployHub builds and runs Python apps on Python 3.12: dependency install, Django, FastAPI and Flask detection, gunicorn, uvicorn and port 8000.
- Deploy with your own DockerfileUse your own Dockerfile on DployHub for full control over the runtime: how detection works, the EXPOSE port rule, Dockerfile path and best practices.
- Port and health checks for zero-downtime deploysHow DployHub uses your port and health check path to release new versions with zero downtime, what the failure messages mean and how to fix them.
- Fix a failed build on DployHubYour deploy failed during the build? Learn what the common build errors on DployHub mean and how to fix detection, start command, clone and timeout issues.