Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network conflict #1004

Open
QThans opened this issue Dec 27, 2024 · 5 comments
Open

network conflict #1004

QThans opened this issue Dec 27, 2024 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@QThans
Copy link

QThans commented Dec 27, 2024

To Reproduce

using two same docker-compose to create services.

Current vs. Expected behavior

if deploy 2 compose has same configuration, the second deploy will using the first. for example, if there are all have pg, the second service will connect to the pg from the first service.

Provide environment information

Operating System:
    OS: Ubuntu 22.04

Which area(s) are affected? (Select all that apply)

Docker Compose

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

Yes

@QThans QThans added the bug Something isn't working label Dec 27, 2024
@Siumauricio
Copy link
Contributor

Siumauricio commented Dec 27, 2024

Hi, yes you are right, this is a bug that I am seeing for some time you can not deploy 2 equal templates because it is possible to mix the information and cause bad gateway errors or something like that and it is because in the dokploy-network the service names must be unique, currently I have not found a way to solve it that is elegant, I know it is something related to networks but I have no idea to solve it, I have tried different methods but none with the success I want without having to do a lot of magic behind compose.

If you have any idea how to solve it in an elegant and direct way that is not something so manual would be great

I believe is related to this #821

@QThans
Copy link
Author

QThans commented Dec 27, 2024

#821

maybe, You can add a random variable which can into docker-compose?

@QThans
Copy link
Author

QThans commented Dec 27, 2024

how about insert service-name into configuration.
if the original name is pg, we can let it be like: pg-{service-name}. then we can use pg-{service-name} to connect. also can consider insert the random string.
@Siumauricio

@QThans
Copy link
Author

QThans commented Dec 27, 2024

I think this can solve the problem of official templates at least.

@Siumauricio
Copy link
Contributor

Siumauricio commented Dec 27, 2024

Yes, I was thinking about some of that, I just didn't like it because it was something that had to be done manually and I don't know how comfortable people would feel doing that.

I assumed that adding --project-name would add the prefix to all containers, and it does but in the internal way of communication it directly uses the name of the service, so if you have a service like db in multiple compose, there might be problems.

https://docs.docker.com/reference/cli/docker/compose/#options

yes a temporary solution is to add a prefix to every container

@Siumauricio Siumauricio added the help wanted Extra attention is needed label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants