fix(ui): expose isStaticSpa toggle for nixpacks + publish directory - #4994
Merged
Siumauricio merged 1 commit intoAug 6, 2026
Merged
Conversation
The backend already honors isStaticSpa for the Nixpacks builder when a publishDirectory is set (getStaticCommand generates an SPA-aware nginx config with try_files fallback to index.html), but the build type form only wired the field for the Static builder. As a result the toggle never rendered for Nixpacks and any save in that mode silently cleared the flag via the discriminated union schema and resetData mapping. Add isStaticSpa to the nixpacks schema variant and resetData case, render the same SPA checkbox once a publish directory is set, and include the field in the save mutation payload for nixpacks. Fixes Dokploy#4993
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.
What
Exposes the Is Static SPA toggle in the Build Type form for Nixpacks + Publish Directory, and stops the flag from being dropped on save in that mode.
Fixes #4993
Why
The backend already supports
isStaticSpafor Nixpacks builds: when apublishDirectoryis set,nixpacks.tscallsgetStaticCommand(application), which readsisStaticSpaand, when true, generates the nginx config with the SPA fallbacktry_files $uri $uri/ /index.html.However, the UI form in
apps/dokploy/components/dashboard/application/build/show.tsxonly wiredisStaticSpainto thestaticvariant of thez.discriminatedUnion. As a result, forbuildType: nixpacks:null.Net user-facing effect: a deep-link hard-refresh / cold-start on a client-side route (
/planning,/users/:id, …) returned a404from nginx becausetry_fileswas absent — the SPA never loaded on first hit. This is a very common setup for monorepos where theStaticbuild type can't run the build step.The Dosu triage on #4993 confirmed the gap and traced it to an integration oversight between #297 (Nixpacks
publishDirectorysupport) and #1931 (which added theisStaticSpatoggle only forstatic). Railpack does not callgetStaticCommand, so it is intentionally left untouched.Changes
Single file, UI-only, no backend change:
isStaticSpa: z.boolean().default(false)to thenixpacksdiscriminated-union variant.resetData'snixpackscase.isStaticSpain the submit payload forstaticornixpacks(elsenull).buildType === nixpacks && publishDirectoryis set — reusing the exact pattern of thestaticblock, with a distinct DOM id (checkboxIsStaticSpaNixpacks) to avoid a duplicate id.Testing
pnpm --filter=dokploy run typecheck(tsc --noEmit): clean, no diagnostics. The discriminated union now typesisStaticSpa: booleanfornixpacks, andresetDatastays exhaustive/symmetric withstatic.pnpm exec biome checkon the touched file: clean, no fixes applied.Honest disclosure per CONTRIBUTING: I verified the change by typecheck + Biome + code review of the schema/reset/render paths, but I did not run the full local stack (Docker + Postgres + server:3000) for an interactive browser round-trip. The backend path this restores (
getStaticCommand→ nginx SPA fallback) is already proven working on a real running instance — withisStaticSpaforced directly in the DB, the generated nginx servesindex.htmlwith HTTP 200 on client routes; this PR only reconnects the UI plumbing to that already-working backend path. Happy to add a screencast or a scoped test onshow.tsxif maintainers prefer.Greptile Summary
This PR exposes the existing SPA setting for Nixpacks applications that specify a publish directory and preserves that setting through build-configuration saves.
isStaticSpato the Nixpacks form schema and reset data.Confidence Score: 5/5
The PR appears safe to merge, with no concrete changed-code failure identified.
The added field is consistently represented in validation, reset state, submission, and rendering, while the checkbox visibility matches the Nixpacks builder condition that activates static publishing.
Reviews (1): Last reviewed commit: "fix(ui): expose isStaticSpa toggle for n..." | Re-trigger Greptile