This commit is contained in:
Michael committed 2026-08-06 19:04:06 +12:00
1 parent acb5070622
commit 07d2595678
3 files changed
+78 -33

No files matched your search

+27 -14
View File
@@ -47,12 +47,15 @@ the full list and a description of each. The two driver toggles:
- **`DB_DRIVER`**: `postgres` (default) or `sqlite`. With `sqlite`,
`DATABASE_URL` is a file path (e.g. `./data/vlog.db`) instead of a DSN, and
the schema is applied idempotently on startup — no golang-migrate, no
external DB needed. Meant for local dev/testing; use Postgres in
production.
external DB needed. Good for local dev/testing, and just as fine for a
real single-server/personal-use deployment (see `deploy/docker-compose.yml`)
— use Postgres only if you actually need a separate DB server.
- **`STORAGE_DRIVER`**: `s3` (default) or `local`. With `local`, uploads are
written under `LOCAL_STORAGE_PATH` (default `./data/uploads`) instead of
S3 — no AWS credentials needed. Meant for local dev/testing; use S3 in
production.
S3 — no AWS credentials needed. Same story: fine for production too as
long as the volume backing `LOCAL_STORAGE_PATH` is actually durable (i.e.
a real disk/volume, not ephemeral container storage) — use S3 if you want
uploads off-box.
Everything else (`OIDC_*`, `PUBLIC_BASE_URL`, `JWT_SIGNING_SECRET`) is
required regardless — there's no toggle for OIDC, you'll need a real (or
@@ -80,31 +83,41 @@ dev server side by side.
## Deploying
`deploy/docker-compose.yml` is wired for `DB_DRIVER=sqlite` +
`STORAGE_DRIVER=local` out of the box — config as literal env values right
in the file (no separate `.env`), matching the convention used for other
services on the host: one folder per service, `./data` bind-mounted in,
published on a `127.0.0.1` port for the host's own Caddy to reverse-proxy
to. Fill in the `OIDC_*`/`PUBLIC_BASE_URL`/`JWT_SIGNING_SECRET` placeholders
(still required either way — there's no toggle for OIDC), then:
```sh
cd deploy
cp .env.example .env # fill in real values (DB_DRIVER=postgres, STORAGE_DRIVER=s3)
docker compose up -d --build
```
This starts one container: `app` (the Go binary, built via
This starts one container: `vlog` (the Go binary, built via
`backend/Dockerfile`, which builds the frontend and embeds it in the same
multi-stage build), published on `PORT` (default `8080`). Postgres, the
OIDC provider, and TLS termination are all assumed to already exist —
nothing else runs in this compose file.
multi-stage build), published on `127.0.0.1:4012` (pick any free port —
that's what your Caddy config points at). The OIDC provider and TLS
termination are assumed to already exist — nothing else runs in this
compose file.
Point your existing Caddy config at it:
```
garage.example.com {
reverse_proxy localhost:8080
reverse_proxy localhost:4012
}
```
(Use the app container's name instead of `localhost` if your Caddy also
runs in Docker on the same network.)
To use Postgres + S3 instead, swap the relevant env values for the ones in
`deploy/.env.example` (a full reference list of every var the app reads).
The schema applies automatically on every `app` startup — there's no
separate migrate step to remember.
The schema applies automatically on every startup — there's no separate
migrate step to remember, and for SQLite specifically, adding a new column
to an existing local DB file is also handled automatically (no need to
delete and recreate it as the schema evolves).
## Verification checklist