T13.8: run the stack in Docker on a PC, local compose override and steps (D22); log BL-070
This commit is contained in:
@@ -485,6 +485,35 @@ If the sync cannot reach Okta, or Okta gives an answer the sync cannot trust, th
|
||||
sync changes **no** account in that cycle and writes a line to the api log:
|
||||
`docker compose logs api | grep "Okta sync"`.
|
||||
|
||||
## Run the stack on your own PC (T13.8)
|
||||
|
||||
Use this to check a build in Docker before you deploy it. It needs Docker Desktop.
|
||||
Do not use it on the host.
|
||||
|
||||
1. Copy `.env.local.example` to `.env` in the repository root. Change the two
|
||||
`CHANGE` values: the database password and `AUTH_SECRET_KEY`.
|
||||
2. Run these commands in the repository root:
|
||||
|
||||
docker compose -f docker-compose.yml -f docker-compose.local.yml up -d --build
|
||||
|
||||
3. Open `http://localhost:8080/api/health`. The answer is `{"ok":true}`.
|
||||
4. Read the api log: `docker compose logs api`. The log shows each database
|
||||
migration, then one `Okta sync` line. With no `OKTA_API_TOKEN`, the line says
|
||||
`DISABLED`. That is correct.
|
||||
5. To stop it and keep the data, run
|
||||
`docker compose -f docker-compose.yml -f docker-compose.local.yml stop`.
|
||||
To stop it and delete the data, replace `stop` with `down -v`.
|
||||
|
||||
What this proves: the images build, all migrations run on Postgres, and the app
|
||||
starts. What it does not prove: sign-in. Okta sends the browser back to the
|
||||
redirect URI that is set for the Okta app, and that is the production host name.
|
||||
To rehearse the Okta sync against your real Okta, add `OKTA_API_TOKEN` and
|
||||
`OKTA_ORG_URL` to `.env` and keep `OKTA_SYNC_DRY_RUN=true`. The local database has
|
||||
no real users, so every real Okta user shows as a non-match. Use it only to check
|
||||
that the token works and that the log lines appear.
|
||||
|
||||
The override file `docker-compose.local.yml` explains each change that it makes.
|
||||
|
||||
## Permissions roles
|
||||
|
||||
`User.role` is the **permissions** role; `User.project_role` is the person's **job
|
||||
|
||||
Reference in New Issue
Block a user