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.
What you need
Section titled “What you need”- The Quickstart finished — agent installed, device named
my-first, you’re logged in. - A
docker-compose.ymlfor your app, on the device, listening on a port. We’ll use port 3000 in this example.
The compose file
Section titled “The compose file”Use whatever you already have. For the sake of a complete example, here’s a minimal stack:
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, not0.0.0.0:3000. Edgible reaches the workload through the loopback interface; binding to0.0.0.0would 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.
The application YAML
Section titled “The application YAML”Save this as app.yml next to your docker-compose.yml:
apiVersion: v3kind: Applicationmetadata: 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.
Deploy
Section titled “Deploy”edgible stack deploy -f app.ymlWait for ready:
edgible stack status -f app.ymlOnce ready, the URL is in the status output. Visit it in a browser; your container responds.
Updating
Section titled “Updating”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.
Rolling back
Section titled “Rolling back”The control plane keeps a small history of previous declarations per application. To roll back to the previous version:
edgible application rollback -i <app-id>(Or just keep the previous app.yml in version control and stack deploy the older version — both work.)
Tearing down
Section titled “Tearing down”edgible stack teardown -f app.ymlThe 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.