-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Docker container custom labels #296
Comments
Hi! There's a dedicated variable for each service which lets you inject additional matrix_synapse_container_extra_arguments: ['--label key=value', '--label another=value'] You can use |
Oh, sweet! Somehow I missed that. Thanks so much for your detailed reply! I really appreciate this project, thanks for helping so much! |
You're welcome! Happy to hear that! |
@spantaleev Finally getting around to this. I can't get the Nginx proxy container to not expose 80 and 443, so it won't start. (I need it to expose nothing, or unused ports, because I am using 80 and 443 for Traefik.) Any idea on how I can use the built in Nginx container without any port mappings? |
@lpulley, as of right now, Until we do, I suggest that you modify See if removing these port mappings and doing all your other tweaks leads you to a nice and working setup. If it does, we should definitely investigate how to remove the port mappings by tweaking playbook configuration. |
Thanks!!
The relevant lines of my
Do I need some line in my |
Our nginx reverse proxy requires that certificates are available one way or another. An https-enabled vhost is always part of the nginx configuration and it attempts to look for certificates. You may wish to use How do you think of plugging traefik into this whole thing? Making it talk to nginx? Or to each service container? |
Looks like My plan with Traefik has been to attach labels to the Nginx proxy container and set all containers to be part of the Traefik network, using the following configuration:
Ideally, the container will generate self-signed certificates to make itself happy, and never use them. Traefik will generate the certificates for the three subdomains and direct all Essentially what I'm looking for is a way to politely ask Nginx to not do strict SSL, and to let me handle it in the reverse proxy, which is typical as far as I am aware. |
Problem is, nginx only serves meaningful stuff on the HTTPS-enabled vhost. Can you make traefik talk to the HTTPS-enabled vhost and not choke on its self-signed certificates? Although.. I think I've had some trouble with self-signed certificates and nginx.. It would get confused for some reason and drive all traffic to the same vhost, regardless of the host I'm trying to talk to. |
I can try routing it like that, but that would be using Traefik's TCP routing, not HTTP, which isn't ideal but might work for me for now. I think it would be worth adding a config item to use Nginx with only plain HTTP, for other people running behind a reverse proxy besides Nginx. |
@lpulley, good news! I have added support for nginx to work in plain-HTTP-only mode. See the documentation here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-own-webserver.md#method-2-fronting-the-integrated-nginx-reverse-proxy-webserver-with-another-reverse-proxy Let me know if anything else is needed to get Traefik working! Also, documenting your Traefik setup somewhere once you get it working would be nice! |
You're a saint!! I have everything working (with the exception of Coturn, but if there's a way to fix that I'd be willing to help). The configuration I'm using differs a bit from the example you put in the docs, but I believe it's the ideal way for Traefik to interact with Synapse and Nginx:
The main difference from your example is that I decided to eliminate the HTTP and federation port binds entirely and have Traefik route directly to the Nginx (on 443) and Synapse (on 8448) containers, as Traefik typically does things with the Docker provider. This does mean that port 8448 on the Nginx container goes unused but that shouldn't be a problem, since it just redirects to the Synapse container on 8048 and I have Traefik doing that instead. This now has Matrix working for me with no modifications between This is fantastic because it means I can treat this playbook as I do my other Docker services: all of the app configuration is in the same file as the reverse proxy options, and when the containers are down Traefik recognizes it and removes the routing rules. I'll go ahead and edit the doc you linked above to match this, unless you think it should have both. I'm by no means a Traefik expert, but from everything I've read it seems like the method above is the "right" way. |
Great to hear that! Thank you for contributing your documentation improvements in #325. |
Hi all,
I'm currently using Traefik for my reverse proxy. Traefik grabs configuration data for containers from labels on running Docker containers, so I'm wondering if there is a way for me to assign labels to the Matrix containers from the
main.yml
. If not, is this something that could be easily added? I'm not familiar with how the containers are started in this playbook, but it shouldn't be hard to "inject" labels at runtime withdocker run -l
or something like that.Doing things this way also requires the containers to be on the same Docker network; can I use
matrix_docker_network
to change the Docker network of the Matrix containers to match the network of my Traefik container?Thanks!
The text was updated successfully, but these errors were encountered: