feat: implement Docker stack module for local backend management#42
Draft
Yasirunet wants to merge 24 commits into
Draft
feat: implement Docker stack module for local backend management#42Yasirunet wants to merge 24 commits into
Yasirunet wants to merge 24 commits into
Conversation
Deploying postkit with
|
| Latest commit: |
fcfc4ee
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8f85ab20.postkit.pages.dev |
| Branch Preview URL: | https://feat-docker-stack-integratio.postkit.pages.dev |
…/Postkit into feat/docker-stack-integration
…-based configuration
…d client credentials with automatic PostgREST updates.
…k client retrieval
…g stack initialization
… during stack setup
…during stack startup
…ng, and handle empty migration results gracefully
…dant healthcheck from keycloak compose config
…dge and explicit network naming
…nly run during initial deployment
…ory seed deployment during stack initialization
…ructure to scaffold roles and schema files
… targets with validation
… directory into container
…e mapper, and move Keycloak provider syncing to initialization
… modules and workflows
supunappri99
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: implement Docker stack module for local backend management
Branch:
feat/docker-stack-integration→developmentSummary
postkit stackmodule that manages Postgres, Keycloak, PostgREST, and Traefik as a Docker Compose project with a two-phase startup (infra first, app services after DB is initialized)is_initialDB-backed state so realm import and JWKs fetch only run on firststack up(auto-resets when volumes are wiped withstack down --volumes)Changes
cli/src/modules/stack/with commands:up,down,status,logs,restart,keys,realmstack up— postgres+traefik start first →applyStackDeploy(infra SQL + migrations + seeds, hard failure) → keycloak+postgrest startis_initialflag — stored inpostkit.stack_configtable (postkitschema); resets automatically onstack down --volumespostkit init— requires project name (generates<name>_<hex>), scaffoldsdb/infra/001_roles.sql+002_schemas.sql, copies Keycloak provider JARs to.postkit/auth/providers/vendor/providers/primary-role-mapper-1.0.0.jar) mounted at/opt/keycloak/providers; project-specific JARs supported viaauth/providers/<name>/target/cleanRealmTemplate()(idempotent)KC_DB_SCHEMA: auth, Agroal pool env vars,KC_BOOTSTRAP_ADMIN_*for v26 compatibility; explicit Docker network name to allowkeycloak-config-clito joinstack restart— variadic service targets with name validationtest/modules/stack/(unit: compose, realm-init, scaffold, sync-providers, db-init, stack-config, stack-state, restart);test/e2e/(smoke/stack-commands, error-handling/stack-config-errors, workflows/stack-init-workflow)cli/docs/stack.md(new), updatedCLAUDE.md,cli/docs/architecture.md,cli/docs/e2e-testing.md; Docusaurus stack module pages + sidebar wiredType of Change
Test Plan
npm run test)npm run test:e2e) (if applicable)npm run build)postkit stack up→ two-phase startup, realm import, JWKs fetch;postkit stack down --volumes→ resetsis_initial;postkit stack restart keycloak→ selective restart;postkit stack keys --restart→ syncs PostgREST JWT configBreaking Changes