Add Docker Compose local dev stack (fully self-contained) #4
Loading…
Add table
Add a link
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?
Lineage
plan-mcd-tracker→ Phase 7c (Local Dev Stack + Playground Cleanup)Repo
forgejo_admin/mcd-tracker-appUser Story
As a developer validating changes before production
I want a fully self-contained Docker Compose stack with postgres, keycloak, api, and app
So that I can run
docker compose upand test the full flow locally before pushing to prodContext
Phase 7 deployed MCD Tracker to production without local dev validation. 6 sequential hotfixes ensued. This establishes the required validation layer. The stack must be fully self-contained — zero external dependencies, works offline. Keycloak runs in dev mode with realm import. API auto-migrates on startup (Alembic). App gets hot reload via Vite dev server. Production URLs remain as fallback defaults when env vars are not set.
File Targets
Files to create:
docker-compose.yml— 4-service stack (postgres, keycloak, api, app)dev/realm-export.json— Keycloak realm: mcd-tracker, client: mcd-tracker-app (public, PKCE), test users (testuser/testpass, testadmin/testpass, emptyuser/testpass), registration enableddev/seed-data.py— Test data seeder: 5-10 Denver McDonald's locations, mix of active/redeemed/expired codes, test receipts.env.example— Documents all VITE_* env vars with local defaultsFiles to modify:
src/lib/api.js— Useimport.meta.env.VITE_API_URLwith production fallback (https://mcd-tracker.tail5b443a.ts.net)src/lib/keycloak.js— Useimport.meta.env.VITE_KEYCLOAK_URL,VITE_KEYCLOAK_REALM,VITE_KEYCLOAK_CLIENT_IDwith production fallbacksFiles NOT to touch:
Dockerfile— production build, works as-is.woodpecker.yaml— CI pipeline, no changes neededcapacitor.config.ts— mobile config, unrelatedAcceptance Criteria
docker compose configvalidates without errorsdocker compose upstarts all 4 servicessrc/lib/api.jsusesimport.meta.env.VITE_API_URL || 'https://mcd-tracker.tail5b443a.ts.net'src/lib/keycloak.jsuses env vars with production fallbacks.env.exampledocuments all VITE_* varsdev/realm-export.jsoncontains valid Keycloak realm configdev/seed-data.pycreates test data against local APITest Expectations
docker compose config— validates YAMLdocker compose up— 4 services start, postgres healthy, keycloak healthycd ~/mcd-tracker-app && docker compose configConstraints
start-devmode (no SSL, fast startup)../mcd-tracker-api(sibling directory)KC_BOOTSTRAP_ADMIN_USERNAME/KC_BOOTSTRAP_ADMIN_PASSWORD(not deprecated KEYCLOAK_ADMIN)exec 3<>/dev/tcp/localhost/8080(no curl in image)Checklist
Related
mcd-tracker— project this affectsplan-mcd-tracker— Phase 7c