Registry Mirror
Skip to content

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

Refs #325

Problem

The root docker-compose.yaml could not start a v2 server. It only did env_file: - .env, but v2 is configured purely through CLI flags (nothing in cmd/ or internal/config reads environment variables) and the image runs ENTRYPOINT ["./authorizer"] with CMD []. docker compose up therefore booted with no flags and died with client ID missing in rootArgs (cmd/root.go:702), or failed earlier when no .env file existed.

Fix

  • docker-compose.yaml: the required flags now live in command: (SQLite on a named volume, URL, client id/secret, admin secret, HS256 JWT secret, encryption key). Every secret is an obvious change-me-* placeholder, with a header comment saying it is for local development only. Dropped the obsolete version: key.
  • Dockerfile: pre-create /authorizer/data before the existing chown, so a named volume mounted there inherits uid 1000 ownership and the non-root user can create the SQLite file. Before this, a named volume at a path the image didn't own was root-owned, and the docs had to recommend -u root.

Verification

Built and ran the stack with docker compose (host port overridden to 18080 to avoid local conflicts):

  • fresh start healthy in ~2s; /app and /dashboard return 200;
  • /authorizer/data/authorizer.db is created and owned by authorizer (uid 1000), process runs as uid 1000;
  • signed up a user, docker compose restart, healthy again, _users still returns the user (total 1), login works.

Not included

The Caddy reverse-proxy example requested in #325, so this PR refs rather than closes it. Follow-up for the docs: the Docker page can drop the -u root workaround for images built from this commit onward.

@lakhansamani
lakhansamani merged commit 8880623 into main Nov 26, 2026
3 checks passed
@lakhansamani
lakhansamani deleted the fix/325-docker-compose-v2 branch November 26, 2026 10:12
lakhansamani added a commit to authorizerdev/docs that referenced this pull request Nov 26, 2026
…ker volume (#105)

* docs: Postgres schema via search_path, magic link flow, root-less Docker volume

- databases: document --database-url ...&search_path=<schema> (verified on
  Postgres 16: all authorizer_* and OpenFGA tables land in the schema,
  public untouched; schema must exist beforehand) (authorizerdev/authorizer#178)
- graphql-api/endpoints: full magic link flow — required flags, redirect_uri
  precedence and validation, emailed link shape, /verify_email behaviour
  (session cookie, no tokens in URL per GHSA-44vr-f829-xfch), getSession
  example, MFA redirect, and current limitations (code not redeemable,
  --redirect-uris exact match) (authorizerdev/authorizer#406)
- docker: root-less named volume at /authorizer/data from v2.4.9
  (authorizerdev/authorizer#930), -u root for older images, docker-compose

* docs(docker): fix compose example to mount the volume at /authorizer/data

* docs(magic-link): document the v2.4.9 fixes (redeemable /verify_email code, exact redirect URIs, encoded links)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant