Lawn Compose
Format
Compose file structure, value formats, and Compose Specification compatibility.
Custom templates are not yet supported in the app. For now, we're temporarily curating the catalog. Support for importing and sharing custom templates is coming soon.
Compose files define the services that make up your app. Each service specifies an image, and optionally environment variables, volumes, ports, health checks, and resource limits.
services:
app:
image: <image-url>
environment:
TZ: ${TIMEZONE:-UTC}
ports:
- "8080:80"
volumes:
- ./data:/app/data
deploy:
resources:
limits:
memory: 512M
Value Formats
Volume paths — Relative paths (e.g., ./data:/app/data) resolve against the instance's data/ directory. Absolute paths are used as-is.
Duration values — 10s, 2m, 1h, or a plain number (interpreted as seconds).
Memory values — 512M, 2G, 1024m, or a plain number (interpreted as MB).
Compose Specification Compatibility
Lawn aims to be compatible with the Compose Specification . The tables below show the current state. Unsupported fields are silently ignored — they won't cause errors, but they have no effect at runtime. We may add support for additional fields in the future.
Supported Fields
| Field | Description |
|---|---|
services.<name>.image | Container image with tag |
services.<name>.command | Override the default command |
services.<name>.working_dir | Override the working directory |
services.<name>.user | Run as specific user (UID, UID:GID) |
services.<name>.environment | Environment variables (mapping syntax only) |
services.<name>.volumes | Volume mounts (short syntax: host:container[:ro]) |
services.<name>.ports | Port mappings (short syntax: host:container[/protocol]) |
services.<name>.depends_on | Service dependencies (list syntax only) |
services.<name>.healthcheck | Health check (test, interval, timeout, retries, start_period) |
services.<name>.deploy.resources.limits | Resource constraints (cpus, memory) |
Unsupported Fields
| Category | Fields |
|---|---|
| Build | build, dockerfile, context |
| Networking | networks, network_mode, dns, extra_hosts, hostname |
| Named volumes | Top-level volumes key, named volume references |
| Configs & secrets | configs, secrets |
| Scaling | scale, deploy.replicas |
| Restart | restart, deploy.restart_policy |
| Logging | logging, driver, options |
| Security | cap_add, cap_drop, privileged, security_opt, read_only |
| Process | entrypoint, init, stop_signal, stop_grace_period |
| Other | labels, stdin_open, tty, tmpfs, shm_size, env_file, profiles, links, ulimits, sysctls, group_add |
| Long syntax | Long-form volumes and ports |
Continue reading