Support cross-application URLs for Preview Deployments
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 3k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 73
Description
What problem will this feature address?
When a project has separate frontend and backend applications, Dokploy creates independent Preview Deployment URLs for each application, even when they belong to the same GitHub PR.
For example:
Frontend:
https://preview-xyz-frontend-wtcxno-etzxkc.preview.xyz.com/
Backend:
https://preview-xyz-backend-zeeuhb-dtzv3p.preview.xyz.com/
Dokploy already exposes DOKPLOY_DEPLOY_URL for an application to access its own preview URL, but the frontend has no simple way to discover the backend preview URL belonging to the same PR.
This makes frontend/backend preview deployments difficult because the generated backend URL changes and cannot be safely hardcoded.
Describe the solution you'd like
Allow applications in the same Preview Deployment / PR to reference each other's DOKPLOY_DEPLOY_URL.
For example, the frontend could use:
NEXT_PUBLIC_API_URL=${{backend.DOKPLOY_DEPLOY_URL}}
and Dokploy would resolve it to the backend Preview Deployment belonging to the same PR.
Similarly:
CORS_ALLOWED_ORIGINS=${{frontend.DOKPLOY_DEPLOY_URL}}
The reference should always resolve to the current preview deployment, so redeploying the backend and receiving a new preview URL would automatically update the value.
The lookup should be isolated by PR so PR #1 can never resolve the backend preview from PR #2 or production.
This would allow separate frontend/backend Preview Deployments to work together without manually copying URLs, custom Traefik configuration, DNS workarounds, external scripts, or API automation.
Describe alternatives you've considered
Currently the alternatives are hardcoding the generated backend preview URL, manually copying the URL after every deployment, using external automation to synchronize the URLs, configuring custom proxy/routing rules, or deploying the frontend and backend together as a single Compose application.
The existing DOKPLOY_DEPLOY_URL solves the problem of an application knowing its own preview URL, so extending this to reference another application's preview URL would be a simple and natural solution for multi-application Preview Deployments.
Additional context
No response
Will you send a PR to implement it?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Preview Deployment handling and the existing DOKPLOY_DEPLOY_URL environment-variable resolution entry points; the issue names no files or tests. Trace how applications are associated with a GitHub PR, then define completion as resolving cross-application references within the same PR while preventing production or other-PR URLs from being selected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100