Compose
Table of contents
Jerboa compose is a small, project-local stack format implemented in internal/compose/.
File Format
version: "1"
services:
api:
image: api:latest
memory: 256M
cpus: 1
depends_on: [db]
networks: [app]
ip: 10.100.0.10
environment:
- PORT=8080
ports:
- "8080:8080"
volumes:
- data:/var/data
health_check: "http:8080:/healthz"
restart: "on-failure:5"
networks:
app:
driver: bridge
subnet: 10.100.0.0/24
volumes:
data:
size: 1G
What The Parser Enforces
version, if present, must be"1"- at least one service is required
- every service must define
image depends_ontargets must exist- referenced networks must exist in the top-level
networksmap - referenced named volumes must exist in the top-level
volumesmap
Current Runtime Semantics
- only the first network in
networks:is actually wired to a service instance - services reach each other by service name over the daemon’s guest DNS (e.g. a
webservice connects todb:5432); see Service Discovery ip:pins a service to a static address on its network; without it the daemon’s IPAM allocates one. Name resolution works either way, soip:is only needed when a fixed address is required- top-level volumes are auto-created during
compose up - top-level networks are auto-created during
compose up compose down --volumesremoves only volumes created by that stack- stacks are tracked by a local state file named
.jerboa-compose-state.jsonnext to the compose file
Commands
jerboa compose up stack.yaml
jerboa compose ps stack.yaml
jerboa compose logs stack.yaml api
jerboa compose down stack.yaml --volumes
Current limits:
compose logsis snapshot-only- there is no
compose logs -f
Ordering
Startup order is computed with topological sort from depends_on.
Shutdown order is the reverse of the recorded startup ordering.