Answer the question
In order to leave comments, you need to log in
How to properly connect docker services to traefik?
Hello everyone and Happy New Year!
Please tell me the "best practices" and competent ones for "inclusion" of traefik in the project as a replacement for jwilder/nginx-proxy ?
was guided by this article (taken as a basis) - https://habr.com/ru/post/508636/
configuration files:
https://pastebin.com/uvahpzyF - traefik.yml
https://pastebin.com/rWswuzzq -
docker -compose.yml
Essence of the question:
1. there is a working project that we decided to cut into independent projects / repositories: CMS , react (front), admin panel, etc. Previously, there was a monolith.
2. We made an independent assembly of projects - each of the modules has its own nginx service.
3. To make everything work as one, we launched jwilder|nginx-proxy as a "substrate". However, the transition to orchestration is ahead and it was decided to move to traefik.
4. I added tags to nginx configs of working services:
labels:
- "traefik.frontend.rule=HostRegexp:{subdomain:[az]+}.domain.com
" did not appear.
In this connection, the question arose: how to connect services to traefik correctly?
Answer the question
In order to leave comments, you need to log in
Each service must have its own name. Therefore, for the frontend you write
- "traefik.frontend.rule=HostRegexp:{subdomain:[a-z]+}.domain.com"
- "traefik.backend.rule=HostRegexp:{subdomain:[a-z]+}.domain.com"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question