Practical self-hosting · beginner
05 · Read the contract before running it
Treat Compose as a declarative application model.
What you can take away
- Validate a harmless Compose file and explain its services.
- Save the example as `compose.yaml` in a new empty practice directory
Your trail through this idea
Checking saved progress…
A YAML file can look tidy and still describe the wrong application. Before starting a stack, ask what will run, what it can reach, and where its state will live.
Prerequisite: complete the preceding lesson or bring its worksheet.
Understand the system
Docker Compose describes services, networks, and storage together. The configuration is an application model, not a proof that the application is safe or healthy. An image name specifies software; environment values configure it; mounts connect it to data; ports expose selected connections. These are different responsibilities.
The config command resolves the model, including merged files and variable substitution. docker compose config --quiet validates without printing the resolved configuration. That matters because the full rendered output may include secret values. Syntax validation does not pull images or prove that runtime credentials work.
Work through the case
Original practice file:
services:
lesson:
image: busybox:1.37
command: ["echo", "A configuration is a proposal"]
This is a disposable example, not a production image recommendation. It has one service, no published ports, and no persistent storage. Reading it should reveal those properties without starting anything.
Make something useful
Try this
Original exercise
Save the example as compose.yaml in a new empty practice directory. With a compatible Docker Compose installation, run docker compose config --quiet there. Then add a deliberate indentation error, observe validation fail, and restore the original file. Do not run up for this exercise. Record what validation proved and two things it could not prove. Delete only the practice file when finished.
Check your reasoning
A quick check · for your own learning
What does Compose configuration validation prove?
A self-study prompt. You can retry; this is not an exam.
Keep the result and follow the sources
The payoff is the ability to review a change before executing it. In later modules, every new mount, network, and secret must be explainable in this same application model.
Sources and scope
- Primary documentation or archival source, reviewed 14 November 2026. Additional direct links appear beside the claims they support.
- Editorial basis: Ian's historical self-hosting questions and current repository inspection informed the case selection. Historical requests do not establish current deployment. Private chat records, credentials and host details are excluded.
- Examples and exercises are original educational synthesis. External sources support the stated technical or historical context, not every hypothetical scenario.