Development documentation may include features that are not in the latest release. Read the Lawn 0.8.1 guide.
Overview
Compose files
Lawn templates use compose files to define how an app runs. These files live in the template's lawn-compose/ directory and aim to be compatible with the Docker Compose Specification.
Lawn extends the format with x-lawn keys for features like health checks, environment metadata, notices, and init files.
A minimal compose file defines at least one service with an image:
services:
app:
image: example/app:1.0.0
ports:
- "8080:80"
volumes:
- ./data:/app/data
From there, you can add environment variables, health checks, resource limits, and Lawn-specific extensions. The following pages cover what's supported:
- Format — Compose file structure, value formats, and Compose Specification compatibility
- Extensions — Lawn's
x-lawnextensions for health checks, environment metadata, notices, init files, and directories - Validation — Syntax checks and Lawn-specific validation
FAQ
What happens when a user installs an app?
Lawn creates a separate instance compose file that stores the user's overrides. Each time the app starts, the template and instance files are merged to produce the final configuration. See Merging for details.
What if I use an unsupported field?
Unsupported service fields are ignored and have no effect at runtime. Invalid or unsupported initialization steps in pre_start fail validation. See the compatibility table for supported fields and limitations.
How do I add Lawn-specific features?
Use x-lawn keys in your compose file for health checks, environment metadata, notices, and more. See Extensions.