Split compose dev/prod and relax contact form friction.

Use compose.dev.yaml and compose.prod.yaml with fixed Go cache mounts, block sudo make dev, build Air outside app/tmp for rootless Docker, soften English spam checks, and simplify contact error copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-07 11:41:13 +12:00
parent 3f5235daaf
commit bf110d0bc7
13 changed files with 125 additions and 76 deletions

View File

@@ -20,7 +20,7 @@ make dev # live reload → http://localhost:7331
| `make dev` | Dev with Air + templ browser live reload (default) |
| `make build` | Build production `website` image |
| `make up` | Run production `website` service |
| `make down` | Stop compose services |
| `make down` | Stop dev and prod compose stacks |
| `make generate` | Run `templ generate` in dev container |
| `make tidy` | Run `go mod tidy` in dev container |
| `make logs` | Follow dev container logs |
@@ -63,13 +63,13 @@ If SMTP is not configured, the page shows a mailto fallback instead of the form.
## Dev container
`make dev` mounts `./app` and `./upload` (raw media staging) plus your host Go caches (`~/go/pkg/mod`, `~/.cache/go-build` by default). Override with `GOMODCACHE` / `GOCACHE` in `.env`.
`make dev` uses `compose.dev.yaml`: mounts `./app` and `./upload` (raw media staging) plus your host Go caches (`~/go/pkg/mod`, `~/.cache/go-build` by default). Override with `GOMODCACHE` / `GOCACHE` in `.env`. Prefer `make dev` without `sudo` so those paths resolve correctly.
**Use [http://localhost:7331](http://localhost:7331)** in the browser — the templ proxy injects live reload on `.templ`, `.go`, and `.css` changes. Port 8080 hits the app directly without auto-reload.
Only run **`dev`** or **`website`** at a time if you map both to the same host ports.
Production `website` mounts `./app/images` into the container. It joins the external `caddy` Docker network for reverse proxy labels.
`make up` uses `compose.prod.yaml`: production `website` mounts `./app/images` into the container. Uncomment the Caddy network/labels in that file when deploying behind your reverse proxy.
## Project layout
@@ -86,7 +86,8 @@ app/
upload/ Raw media — run `make sync-media` to publish into app/images/
Dockerfile Production image
Dockerfile.dev Dev image (Go + templ + Air)
docker-compose.yaml
compose.dev.yaml
compose.prod.yaml
.env.example
```