dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Add validation to prevent duplicate domain hosts

Open danielnsilva opened this issue 2 months ago • 1 comments

What problem will this feature address?

I've run into issues where team members accidentally create duplicate domains, which breaks Traefik routing and causes deployments to fail. Right now there's nothing stopping multiple apps from using the same domain.

Describe the solution you'd like

We should prevent duplicate domains by:

  1. Adding a unique constraint at the database level
  2. Checking for duplicates before creating/updating domains
  3. Showing a error message when someone tries to use an existing domain

Describe alternatives you've considered

For now, manually check existing domains before creating new ones and use naming conventions (e.g., project-alpha-app.domain.com, project-beta-app.domain.com), but this doesn't scale well with multiple team members and is error-prone.

Additional context

No response

Will you send a PR to implement it?

Maybe, need help

danielnsilva avatar Nov 17 '25 02:11 danielnsilva

I understand the idea, but in some situations, you'd want to give two services the same domain. Something that could be added is a warning that the domain may already be used by another service.

For example: You put your website on mydomain.com with path / and your backend on mydomain.com with path /api

Edit: just noticed that we could in theory do UNIQUE(domain, path)... I might look into it

cheetahbyte avatar Nov 26 '25 20:11 cheetahbyte