Skip to content

Deploy a Docker Compose app

Most real-world workloads come as a Docker Compose stack — an app container, maybe a database, an environment file, a couple of named volumes. This guide takes that exact shape and exposes it.

  • The Quickstart finished — agent installed, device named my-first, you’re logged in.
  • A docker-compose.yml for your app, on the device, listening on a port. We’ll use port 3000 in this example.

Use whatever you already have. For the sake of a complete example, here’s a minimal stack:

docker-compose.yml
services:
web:
image: ghcr.io/your-org/your-app:latest
ports:
- "127.0.0.1:3000:3000"
environment:
- DATABASE_URL=postgres://app:app@db:5432/app
depends_on:
- db
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=app
- POSTGRES_PASSWORD=app
- POSTGRES_DB=app
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:

A few things to note:

  • The web container binds to 127.0.0.1:3000, not 0.0.0.0:3000. Edgible reaches the workload through the loopback interface; binding to 0.0.0.0 would unnecessarily expose the port on the device’s other interfaces.
  • The database has no ports: block. It’s only accessible to the web container over the Compose network — exactly the topology you want.

Save this as app.yml next to your docker-compose.yml:

app.yml
apiVersion: v3
kind: Application
metadata:
name: my-app
organization: <your-org-id>
spec:
placement:
strategy: serving-device
deviceSelector:
deviceName: my-first
workloads:
- name: stack
type: compose
composeFile: ./docker-compose.yml
ports:
- { name: http, containerPort: 3000, protocol: tcp }
access:
- name: public
type: https
target: { workload: stack, port: http }
hostname: { generated: true }
tls: { managedBy: edgible }
policies:
auth: { mode: none }

The composeFile path is resolved relative to the application YAML. The agent will read it, ship it to the device, and run docker compose up -d against it.

Terminal window
edgible stack deploy -f app.yml

Wait for ready:

Terminal window
edgible stack status -f app.yml

Once ready, the URL is in the status output. Visit it in a browser; your container responds.

Change the image tag, the env vars, or the compose file itself. Re-run stack deploy. The agent diffs old vs. new and applies the change — typically a docker compose up -d with the new spec, which restarts only the containers whose definition changed.

The control plane keeps a small history of previous declarations per application. To roll back to the previous version:

Terminal window
edgible application rollback -i <app-id>

(Or just keep the previous app.yml in version control and stack deploy the older version — both work.)

Terminal window
edgible stack teardown -f app.yml

The compose stack is stopped and removed, the public route is released, and the certificate is left in place for a short retention window in case you redeploy.