Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just do it like the olden days, use ansible or similar.

I have a couple dedicated servers I fully manage with ansible. It's docker compose on steroids. Use traefik and labeling to handle reverse proxy and tls certs in a generic way, with authelia as simple auth provider. There's a lot of example projects on github.

A weekend of setup and you have a pretty easy to manage system.



What is the advantage of traefik over oldschool Nginx?


Traefik has some nice labeling for docker that allows you to colocate your reverse proxy config with your container definition. It's slightly more convenient than NGINX for that usecase with compose. It effectively saves you a dedicated vietualhost conf by setting some labels.

One can read more here: https://doc.traefik.io/traefik/routing/providers/docker/

This obviously has some limits and becomes significantly less useful when one requires more complex proxy rules.


Basically what c0balt said.

It's zero config and super easy to set everything up. Just run the traefik image, and add docker labels to your other containers. Traefik inspects the labels and configures reverse proxy for each. It even handles generating TLS certs for you using letsencrypt or zerossl.


I thought this context was outside of Docker, because they used ansible as docker compose alternative. But maybe I misunderstood.


Ah yeah I guess I wasn't clear. I meant use ansible w/ the docker_container command. It's essentially docker compose - I believe they both use docker.py.


Ah yes, makes much more sense.


I created a script that reads compose annotations and creates config for cloudflare tunnel and zero trust apps. Allows me to reach my services on any device without VPN and without exposing them on the internet.


There's very little advantage IMO. I've used both. I always end up back at Nginx. Traefik was just another configuration layer that got in the way of things.


Traefik is waaay simpler - 0 config, just use docker container labels. There is absolutely no reason to use nginx these days.

I should know, as I spent years building and maintaining a production ingress controller for nginx at scale, and I'd choose Traefik every day over that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: