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

Change hardcoded traefik.backend setting to dynamic #343

Merged
merged 1 commit into from
Nov 20, 2018

Conversation

0xCardinalError
Copy link
Contributor

Per issue here, I provide a patch that solves this, so you can run multiple d4d projects even without using traefik.yml file on the same machine.

#342

@csandanov
Copy link
Member

it does not help, only one traefik (launched last) works. I don't think multiple traefiks may work with a single docker daemon. Have you seen https://wodby.com/docs/stacks/drupal/local/#running-multiple-projects?

@0xCardinalError
Copy link
Contributor Author

0xCardinalError commented Nov 16, 2018

With this patch you can put multiple d4d docker-compose files wherever on your machine( I am running 3 of them as we speak). Don't need to have sites in the same parent folder with traefik.yml and all that extra config. I am not against documented suggestion, just this way you have more freedom and less configuration. Only way it didnt work was this hardcoded nginx value that would clash.

Anyway that value shouldn't be hardcoded like that, its better to be dynamic per name of site project so think it should be commited, can't hurt, can help.

@csandanov
Copy link
Member

I meant I run 2 docker-compose projects on different ports with different nginx labels and it did not work. Only works traefik that was started last, the first one gets "Gateway timeout". But maybe this is something specific to docker for mac or mounting docker socket.

@igorbiki
Copy link

igorbiki commented Nov 19, 2018

I was able to set up two traefik containers to run, as per @adriadrop. Prefixed "${PROJECT_NAME}_"
on "traefik.backend" line for nginx (fix Marko suggests), but also to portainer, mailhog. Updated ports for traefik "8100:80" and "8200:80" for project1 and project2 respectively. It appears to be working, at least on my end (linux).

@0xCardinalError
Copy link
Contributor Author

0xCardinalError commented Nov 19, 2018

I meant I run 2 docker-compose projects on different ports with different nginx labels and it did not work. Only works traefik that was started last, the first one gets "Gateway timeout". But maybe this is something specific to docker for mac or mounting docker socket.

I am running this on Mac. Also the very thing that happened to me is the gateway timeout, which would come from Nginx, because It was using the same backend in traefik.

So basically all you have to do if using what I suggested is.

Setup different project names
Setup different port for traefik ports: "8000:80"
Add for both projects info into /etc/hosts to point to 127.0.0.1

@csandanov csandanov merged commit 8a2e233 into wodby:master Nov 20, 2018
@csandanov
Copy link
Member

Oh.. my bad, I did not update base urls 🤦‍♂️

@csandanov
Copy link
Member

Thank you! Now all services have the prefix, and this approach documented at https://wodby.com/docs/stacks/drupal/local/#running-multiple-projects

@0xCardinalError
Copy link
Contributor Author

Thank you! Now all services have the prefix, and this approach documented at https://wodby.com/docs/stacks/drupal/local/#running-multiple-projects

I just wanted to say that this is needed on all services, but you beat me to it. Glad this is changed now :)

@0xCardinalError
Copy link
Contributor Author

Thank you! Now all services have the prefix, and this approach documented at https://wodby.com/docs/stacks/drupal/local/#running-multiple-projects

I would just add that for the "different ports" docs you should state that basically they dont need to use traefik.yml file and compose up on it etc.

All they need then is to have different ports and docker-compose up -d their folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants