Skip to Content
NeoRun

Deploy a Compose app

Put a Docker Compose app on your server with a domain, a health check and automatic rollback.

NeoRun deploys apps described by a Docker Compose file. The agent plans the deploy, NeoRun checks it against your server, and then the deploy runs by itself or waits for you, depending on the server's safety level.

What you need

  • A connected server (see Quickstart) and an agent with write access.
  • A Compose file whose services use images that already exist. NeoRun does not build images: build in CI, push, and reference the image.
  • A domain whose DNS points at the server.

Ask your agent

Deploy this app to web-1 on shop.example.org.

The agent calls these tools:

  1. list_servers and inspect_server to look at the server: what listens on which ports, which proxies and sites exist, Docker, disk.
  2. plan_deploy with the server, an app name, the Compose file text and the domain. NeoRun turns it into a typed plan with a hash. This changes nothing on the server.
  3. deploy with the plan id. NeoRun runs it, or holds it for you.
  4. get_status until it is final. The answer says what happened, in NeoRun's words.

What Compose NeoRun accepts

NeoRun accepts a safe subset of Compose and refuses anything else, with a reason.

  • Accepted: image (required), command, entrypoint, environment, working_dir, user, labels, restart, healthcheck, depends_on, expose, ports (only to name the container port to route to), named volumes, and deploy.resources.limits for cpus and memory.
  • Refused because they reach outside the container: privileged, cap_add, devices, network_mode, pid, ipc, userns_mode, security_opt, sysctls, cgroup_parent, bind mounts, the Docker socket, custom or external networks.
  • Not supported yet: build, env_file, secrets, configs.

NeoRun never publishes your app's ports on the server. Traffic comes in through NeoRun's own edge, a Caddy that NeoRun runs on the server.

How it reaches the internet

NeoRun picks a routing mode from what the server looks like:

ModeWhenStatus
directNothing listens publicly on 80 and 443. NeoRun's Caddy publishes them and gets a certificateBuilt
behindA known proxy (nginx, Apache, Caddy, HAProxy, Traefik) holds 80 and 443. NeoRun's edge listens on 127.0.0.1:8780, and the plan names the one step you do by hand: point the proxy's site for the domain at itBuilt
integrateNeoRun adds the site to your existing proxy itself, and checks that every other site still answersPlanned
takeoverNeoRun stops your old proxy and owns 80 and 443, with your approvalPlanned

Planned

integrate and takeover are designed and not built. Today a server that already runs nginx, Apache or Caddy gets behind.

The first deploy in direct mode opens ports 80 and 443 to the world, which is never automatic, so the first deploy to a fresh server waits for you.

What the deploy does

Each step has an undo.

  1. Make sure NeoRun's edge exists (only on the first deploy).
  2. Pull the images.
  3. Create the named volumes. Volumes are never deleted automatically.
  4. Stop the previous version's services that use volumes, so two versions never write the same volume.
  5. Start the new version on its own network, with no host ports.
  6. Health check: the Compose healthchecks are healthy, and an HTTP request to the routed service answers below 500.
  7. Switch the route to the new version.
  8. Verify through the public URL.
  9. Stop (not remove) the previous version, and keep it for rollback.

NeoRun takes a snapshot of a volume before it changes data, and services that keep data run apart from the versions, so the live app stays up while the new version is checked. If a deploy replaces a data service, the plan states the short downtime before you approve it.

After the switch, NeoRun watches the deployment for 10 minutes. If its health fails, NeoRun rolls back automatically. See Checks, watch and undo and Roll back a deploy.

Edit this page on GitHub

On this page