PH0.1 — Compose base: db, LDAP, Keycloak realm, nginx, OSRM #3
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
patrick/Polaris#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Row PH0.1 in
docs/12-implementation-plan.md(branch, owned paths and doc section are defined there).What to build
A fresh clone runs
docker compose upand gets PostgreSQL+PostGIS, OpenLDAP with five users in five groups (admin, planner, technician, viewer, ingest), a Keycloak realm federated to that LDAP (group → realm role, locale mapper, no realm-local users), nginx, and an OSRM service behind a profile. The api/worker/web services are declared but behind--profile appuntil PH0.2/PH0.5 land.Acceptance criteria
docker compose upfrom a fresh clone brings db, openldap, keycloak and nginx to healthypolarisandkeycloakdatabases exist with PostGIS enabledpolaris-web(PKCE),polaris-api(bearer) andfleetpulse(client-credentials) exist in the realm.env.exampleand root README document the startupBlocked by
🚧 Started — session working this on branch
feature/infra-compose-base(owns: infra/**, root README.md, .env.example), in an isolated worktree offmain. Will tick acceptance criteria live as they are met and open a PR (Closes #3) when done.Implemented in #49 (
feature/infra-compose-base). All acceptance criteria verified live (freshdocker compose up,down -v, and re-run from scratch — not justdocker compose config): db/openldap/keycloak/nginx reach healthy automatically; a full LDAP sync imports all 5 users with 0 failures and each logs in with exactly their own realm role (checked by decoding the issued JWT,audincludespolaris-api);polaris/keycloakdatabases exist withpostgis/postgis_topologyenabled;polaris-web/polaris-api/fleetpulseclients all present with the right auth types;osrm/pgadmin/phpldapadmin/api/worker/webstay off without their profile flag.Two things the ticket didn't foresee, both documented inline where they matter:
LDAP bootstrap can't use osixia's own custom-ldif mechanism as a straight bind mount. That image chowns then deletes each file under
bootstrap/ldif/custom/after importing it — fatal ("Device or resource busy") against a single bind-mounted file, and if you instead bind-mount the directory it silently deletes the real repo file from the host. Went with a one-shotldap-initcompose service that runsldapadd -cagainst the running directory instead (idempotent: a second run just logs "already exists" per entry and still exits 0). Commented indocker-compose.yml.docs/07-architecture.md's${env.VAR}placeholders for the LDAP bind DN/password aren't something Keycloak's realm importer or plain LDIF actually resolve — that's envsubst-style templating neither format supports natively, and wiring up an entrypoint wrapper to do it felt like scope creep for M0. Went with fixed, clearly-commented dev-only credentials baked intobootstrap.ldif/realm-polaris.jsoninstead (documented ininfra/compose/.env.exampleand rootREADME.md— same password for all five bootstrap users, fixed LDAP bind password, fixedfleetpulseclient secret). Rotating these for anything beyond a local compose stack is a small follow-up, not blocking M0.Also touched the root
.gitignore(one line,infra/osrm/data/) sinceprepare.shwrites multi-GB extract/dataset files there and noinfra/**-scoped ignore exists yet.