Single part at the root, COMPOSE_FILE in .env

This commit is contained in:
hh
2026-09-08 20:38:27 +02:00
parent a950161b00
commit 1c628625e9
10 changed files with 47 additions and 19 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
# infra
Copier template for the root of a project: `docker-compose.yml` that includes every part, a `Makefile` that drives compose and delegates `fmt`, `check` and `build` to parts, `.env.example`, `.gitignore`, `CLAUDE.md` and pre-commit hooks.
Copier template for the root of a project. With `layout: parts` it ships a `docker-compose.yml` that includes every part, a `Makefile` that drives compose and delegates `fmt`, `check` and `build` to parts, and an `.env.example` whose `COMPOSE_FILE` adds each part's `docker-compose.local.yml`. With `layout: single` a part template renders straight into the root and infra ships only `.gitignore`, `CLAUDE.md` and pre-commit hooks.
A part is a directory with:
- `docker-compose.yml` with root-relative paths, plus `docker-compose.local.yml` and `docker-compose.prod.yml` selected by `COMPOSE_ENV`
- `docker-compose.yml` with root-relative paths, plus `docker-compose.local.yml` and `docker-compose.prod.yml` picked through `COMPOSE_FILE` in the root `.env`
- `Makefile` with `fmt`, `check` and `build` targets
- `.env.example` appended to the root `.env` by `make env`
- `CLAUDE.md` with the part's checking commands
@@ -12,6 +12,6 @@ A part is a directory with:
Application services carry the `services` profile, databases and other infrastructure carry `external`.
```sh
copier copy --trust -d 'parts=["backend","frontend"]' <this-repo> <dest>
copier copy --trust -d layout=parts -d 'parts=["backend","frontend"]' <this-repo> <dest>
copier update -a .copier/infra.yml
```