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

How to access traefik #503

Open
webprogrammierer opened this issue Dec 7, 2021 · 3 comments
Open

How to access traefik #503

webprogrammierer opened this issue Dec 7, 2021 · 3 comments

Comments

@webprogrammierer
Copy link

After successful installation I can access:
http://drupal.docker.localhost:8000/
http://mailhog.drupal.docker.localhost:8000/
http://pma.drupal.docker.localhost:8000/

But how can I access TRAEFIK?
Thank you.

@dclause
Copy link

dclause commented Dec 30, 2021

Hi !
I guess traefik dashboard should be at :
http://drupal.docker.localhost:8080/dashboard/

@webprogrammierer
Copy link
Author

Yes, thank you. I already have found it out by myself.
The "Open in Browser" link in Docker Desktop is wrong.

What is traefik for?

@dclause
Copy link

dclause commented Dec 31, 2021

Hi!
Sort answer : traefik redirects the traffic from your browser to the appropriate container.

Longer answer: when you request a service via the browser using a URL (say phpmyadmin.drupal.docker.locahost:8000), the browser has to transform it into an IP using the hosts file of your OS then a DNS requests if necessary to join the appropriate server. locahost address resolves to 127.0.0.1 which is your local IP.
However, when using this address, you don't actually want to address a server locally but rather a service within a docker container which does not have itself an IP. For that, traefik acts as a sort of middleware, it listens to local traffic on a given port (8000 by default in this project) and redirects it to the appropriate docker container based on a set of urls (basically the URL) so the container can respond.

NOTE:
docker4drupal has a local traefik configured at port 8000 for convenience. It starts in the container with all other services using the docker-compose command. But if you have two projects using docker4drupal you will have two traefik started conflicting. You will therefore need either to change the port of one of the traefik or use a global traefik. That means have another container running traefik in a separate project that can dispatch the traffic to multiple projects.

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

No branches or pull requests

2 participants