Run with Docker Compose
For most people the fastest way to see a working authorization server is the Compose file the
repository ships. It brings up three services: MongoDB, a one-shot provisioning step, and the
server. Nothing needs configuring beyond ISSUER, discussed below.
Prerequisites: Docker with Compose v2 (docker compose, not the older docker-compose).
Start the three services
Section titled “Start the three services”-
Fetch the Compose file:
Terminal window curl -O https://raw.githubusercontent.com/RedFox-Soft/OAuth-server.ts/main/docker-compose.yml -
Decide the
ISSUERvalue now; the warning below explains why. Ifhttp://localhost:3000is not where a browser will reach this server, editISSUERin bothenvironment:blocks ofdocker-compose.yml, thesetupservice’s and theoauthservice’s. Changing only one leaves the seeded redirect URI and the advertised issuer disagreeing, and that mismatch cannot be repaired in place. -
Start everything:
Terminal window docker compose up -
Open the console at
http://localhost:3000/admin. The first visit shows a one-time setup screen that creates the initial super administrator.
What the three services do
Section titled “What the three services do”| Service | Image | Role |
|---|---|---|
mongo |
mongo:8 |
The datastore, on a named mongo-data volume, with a mongosh ping healthcheck the other services wait for |
setup |
ghcr.io/redfox-soft/oauth-server-ts:latest |
Runs bun run db:setup and bun run db:migrate, then exits: collections, indexes, the initial RS256 signing key, the admin panel seed, and any schema migrations |
oauth |
ghcr.io/redfox-soft/oauth-server-ts:latest |
The server itself on port 3000, started only after setup completes successfully. It mounts the named foxauth-keyring volume at /app/keyring, where first-run setup keeps the keyring that encrypts stored secrets |
The server waits for setup for two reasons. Without the reserved administrators’ project and admin-panel client that
setup seeds, the console’s sign-in redirects to a client no Client document matches. The
first-run setup page still works in that state, which can make the fault look like a login bug. The server
also refuses to start against a database whose migrations have not run, which is why setup runs
db:migrate after db:setup. Both commands are safe to repeat, so re-running docker compose up after
pulling a newer image is also the upgrade path; take a backup first when the release notes name a
migration that cannot be undone.
Addresses to open once the server is running
Section titled “Addresses to open once the server is running”- The console at
http://localhost:3000/admin, where you create the first administrator. - The discovery document, which is the authoritative list of endpoint URLs for a client library:
http://localhost:3000/.well-known/openid-configuration. - The key set:
http://localhost:3000/jwks. - A liveness probe that is never rate-limited:
http://localhost:3000/health, and its readiness counterparthttp://localhost:3000/ready, which also reaches the database.
docker-compose.yml runs MongoDB. docker-compose.postgres.yml beside it is the same three services on
PostgreSQL, started with docker compose -f docker-compose.postgres.yml up. The two files are
alternatives; never combine them. See PostgreSQL for the variable that
selects each backend.
For a production-leaning Compose file, with pinned tags, an external database and a TLS proxy in front, see Deploy with Docker Compose.