How builds work
When you deploy a service that comes from a Git repository, it is built into an image on one of your own servers. OpenPanel's servers never see your code.
Everything here works the same from the console, the CLI, the API and MCP. In the console, a service's build is set under Build and start, in New service and on the service's Settings tab: Auto builds with Railpack, Dockerfile with the path you give.
Where a build runs
- On your server. The build runs on the first server the deployment is placed on, by OpenPanel's agent there, with the server's own
gitand Docker'sbuildx. The agent's installer adds both when they are missing. - One at a time. A server runs one build at a time; the next waits for it.
- With the server's resources. A build is not limited: it uses the server's processors and memory, beside the services that run there.
- In a folder of its own. Each build clones into a scratch folder that is deleted when the build ends, and runs with no Git or Docker settings of the server's own.
Railpack or a Dockerfile
| Build | When | What it does |
|---|---|---|
| Railpack | The default, when the service names no Dockerfile | Railpack looks at the service's folder, works out its language and framework, and builds an image without a Dockerfile. See Languages and frameworks. |
| Dockerfile | When you name a Dockerfile | Docker builds the folder with your Dockerfile. See Dockerfile builds. |
A repository that has a Dockerfile is still built with Railpack until you name the Dockerfile in the service's settings.
What a build does, step by step
- Clone. The agent clones the branch's newest commit, or the commit you deployed, and records the commit it got. A commit that differs from the one you asked for fails the build.
- Build. It builds the service's folder in the repository with Railpack or your Dockerfile.
- Keep the image. The image stays on that server, under a name made of the service's and the deployment's ids, and the deployment moves to
deploying. - Clean up. The scratch folder, with the clone and any Git credentials, is deleted.
A path that leads out of the repository, through .. or a symbolic link, fails the build. The build cannot read the server's own files.
Variables do not reach the build
Your service's variables are given to its containers when they run, not to the build. A framework that reads a variable while it builds, for example to put an address into a web page, does not get it. Keep such values in the repository, or read them when the service starts.
Time limits
| Limit | What happens |
|---|---|
| 30 minutes of building | The build stops, and the deployment fails with a message that starts with "The build failed: timed out after 30m0s". |
| 60 minutes from the deploy | A build that has not finished, for example because the server's agent is offline, fails with "The build did not finish within 60 minutes." |
Build output
What the build prints is kept with the deployment as its build log (its first 2 MiB, and the last 200 lines of a longer one):
openpanel logs --deployment "$DEPLOYMENT_ID" --followor GET /deployments/{id}/logs (the MCP tool deployments_logs). See Build and deploy logs.