Skip to content
Skip to Content

Service settings

Every setting a service has, from its source to its servers, with its limits and the rules between them.

A service's settings say what it runs, how it is reached and where. Changing them needs deploy access to the project, and a change takes effect at the service's next deploy: until then the running deployment keeps the settings it was made with.

Change a setting

Open the project and click the service on the canvas. Its Settings tab has one card for each part: Source, Name, Build and start, Networking, Load balancer and replicas, Volumes, Health check, Resources and Servers it may run on. Each card has its own Save, which sends only that card's fields. Then deploy the service from its Overview tab.

openpanel services get web --project shop shows the settings as saved, and GET /services/{serviceId} returns them in full.

Every setting

SettingCLIAPI fieldValues
Name(at create)nameUp to 32 lowercase letters, digits and hyphens, starting with a letter; used once in the project, across its environments
Image--image nginx:1.27source: {kind: "image", image, tag}Docker Hub when no registry is named; tag latest when none is given
Git repository--repo, --git-account, --branch, --pathsource: {kind: "git", accountId, repo, branch, path}Branch main and the repository's root by default
Build--dockerfile <path>build: {kind: "auto"} or {kind: "dockerfile", dockerfile, context}Git sources only; detected when not set
Start command--start "<command>"startCommandUp to 2,000 characters; empty keeps the image's own
Address--public, --private, --no-addressexposure: public, private, nonenone by default
Ports--port http:3000 (repeat)ports: [{protocol, port}]Up to 20; http, tcp or udp; 1 to 65535
Load balancer--balancer, --no-balancerbalancerOff by default; public services only
Replicas--replicas 3replicas1 to 100
Health check--health http:3000:/health, --health tcp:5432healthCheckSee Health checks
CPU limit--cpus 0.5resources.cpus0.1 to 256 CPUs per replica; no limit by default
Memory limit--memory 512resources.memoryMb32 MB to 1,048,576 MB per replica; no limit by default
Servers--server <name> (repeat)serverIdsUp to 50 of your organization's servers
Volumesopenpanel volumes addPOST /services/{serviceId}/volumesUp to 10; see Volumes
Environment--environment <name> (at create)environmentId (at create)The production environment by default

Source

A service runs a Docker image or is built from a Git repository. Changing the source, for example from a repository to an image, takes effect at the next deploy like any other setting. A source that stops being Git loses its build settings.

  • Image: the name may name a registry (ghcr.io/acme/app) and the tag follows a colon. See Deploy an image.
  • Git: repo is owner/name in the Git account, branch the branch to build, and path one folder of the repository for a monorepo. See Deploy from Git.

A member's own Git account can be chosen only by that member. A service that already uses one keeps it when someone else changes its other settings, and its deploys go on using it.

Build

For a Git source only. Without build settings, the build is detected from the repository. With --dockerfile, or build.kind dockerfile in the API, it builds with the Dockerfile at that path; the API also takes context, the folder sent to the build. See How builds work.

Start command

The command each replica runs, in place of the image's own. It runs with /bin/sh -c, so the image needs a shell, and you can write it as you would in a terminal:

openpanel services update web --project shop --start "node server.js --port 3000"

--start "" in the CLI, or "startCommand": null in the API, goes back to the image's own command.

Address

ValueWho reaches the service
publicThe internet, through OpenPanel's edge: each HTTP port at the service's opnl.app address and your own domains, each TCP or UDP port on its own public port
privateEach port gets a port on its server's 127.0.0.1, shown as loopbackPort. Carrying it into your organization's private network is being built; see Private addresses
noneNobody from outside

In every case the project's other services on the same server reach it by its name.

A public service with an HTTP port gets an opnl.app address when it is saved, and loses it when it is no longer public or has no HTTP port left. A service with your own domains cannot leave public until you remove them.

Ports

Each port is a protocol and the port the container listens on: http for websites and HTTP APIs, tcp for anything else on TCP, udp for UDP. A port is listed once per transport, and http and tcp share TCP, so http:80 and tcp:80 cannot both be listed.

The list you send replaces the old one, in the CLI as in the API: name every port the service should keep.

On a service that isAn http portA tcp or udp port
PublicReached through its domains, with HTTPSGets a public port on the edge from 30000 to 32767, shown as edgePort
PrivateGets a port on its server's 127.0.0.1 from 20000 to 29999, shown as loopbackPortThe same
With no addressReached only by the project's other services on the same serverThe same

A port keeps its edgePort or loopbackPort across changes as long as it still needs one.

Load balancer and replicas

replicas is how many copies of the service run. Four rules decide what is allowed:

ServiceReplicas
Public, load balancer off1
Public, load balancer on1 to 100, and the edge balances over them
Private1, and no load balancer
No address1 to 100, without the load balancer
With a volume1, and no load balancer, whatever its address

See Load balancer on or off and Replicas.

Resources

Limits per replica: cpus is a share of the server's processors (0.5 is half of one), memoryMb the most memory in megabytes. A replica that goes over its memory limit is killed, and Docker starts it again.

The two are set together: a change replaces both, so name both to keep both.

openpanel services update web --project shop --cpus 1 --memory 512

Servers

The servers the service may run on. Its replicas are spread over them in turn, in a fixed order; see Replicas. The list you send replaces the old one.

A server that has been disconnected stays in the list until you change it, but nothing is placed on it. A service with a volume must keep the server its volume lives on.

The rules, with their messages

A change that breaks a rule is refused, with one of these messages:

MessageWhat to do
"Turn on the load balancer to run more than one replica of a public service."Add --balancer, or set replicas to 1.
"The load balancer is for public services. Make the service public, or turn the load balancer off."Make it public, or add --no-balancer.
"A service on a private address runs as one instance."Set replicas to 1.
"This service has a volume, so it always runs as one instance. Remove the volume to use replicas or the load balancer."See The single-instance rule.
"Port 80 is listed twice."List each port once; http and tcp count as the same transport.
"The health check uses port 8080; add it as an HTTP port first."A health check's port must be one of the service's ports.
"Build settings are for a service built from Git."Leave out build for an image.
"This service has its own domains. Remove them before taking it off its public address."Remove its custom domains first.
"app.example.com reaches port 80. Remove the domain, or keep that HTTP port."Keep the port the domain points at, or remove the domain.
"The volume at /data lives on a server this change removes. Keep that server in the list."Keep the volume's server among the service's servers.