Build and deploy
Services
AvailableA service is one thing that runs: a website, an API, a background worker.
A service is built and deployed on its own, so releasing the API does not restart the website.
Types
| Type | What it does | Port |
|---|---|---|
| Web Service | Serves HTTP to the internet, through a domain. | Required |
| Private Service | Reachable only from its environment's network. | Required |
| Background Worker | Runs without taking requests. | None |
Adding a service
Open a project, pick an environment, and choose Add Service. Enter a name, the type, and the port your app listens on. Owners, admins and developers can do this.
This only describes the service. Nothing runs until it is deployed, and its status reads Not deployed until then.
Settings
The Settings tab of a service says where it comes from and how it runs.
| Setting | Meaning |
|---|---|
| Source | A ready-made image, or a Git repository with a Dockerfile that RunOne builds. See Deploy from Git. |
| Port | The port the app listens on inside its container. |
| Memory, CPU | Limits for the container. Empty means no limit. |
| Health check | How RunOne decides a new version is good: an HTTP path that answers, a port that accepts connections, or a process that stays up. |
| Redirect HTTP to HTTPS | On by choice. Leave it off behind a CDN that talks plain HTTP to the server. |
Each save creates a new revision. If someone else saved while you were editing, RunOne asks you to reload instead of overwriting their change. Saving does not touch what is running; it takes effect with the next deployment.
The definition as JSON
The same settings are one JSON document, which you can edit at the bottom of Settings or send through the API.
{
"source": { "type": "git", "repo": "[email protected]:acme/web.git", "branch": "main", "dockerfile": "Dockerfile" },
"build": { "env_file": ".env.production", "secrets": ["NPM_TOKEN"], "ssh": true },
"runtime": { "port": 3000 },
"healthcheck": { "type": "http", "path": "/" },
"resources": { "memory_mb": 1024, "cpus": 1 },
"network": { "redirect_https": true }
}Status
A service has a desired state, Running or Stopped: what you asked for. What is actually happening is reported by the server, so the dashboard never shows a wish as a fact.
| Status | Meaning |
|---|---|
| Not deployed | It has never been deployed. |
| Starting, Stopping | The server is carrying out what you asked. |
| Running, Stopped | As asked. |
| Crashed | It keeps exiting. After 5 restarts in 5 minutes RunOne stops restarting it and opens an incident; Start tries again. |
| Missing | It should be running, and its server reports no container for it. Deploy it again. |
| Unknown | Its server has not reported lately. |
Restart, stop, start
The buttons at the top of a service act on what is running, without creating a deployment. Stop keeps the service and its history; Start runs the last active deployment again.