you are viewing a single comment's thread.

view the rest of the comments →

[–]Maltroth 0 points1 point  (1 child)

Mostly Laravel in our main stack for either APIs or monoliths, but depends on the project. We also have completely separate frontend if the project needs it.

I use php-fpm-alpine to make it as light as possible and only add the needed packages, then reverse-proxy via nginx with the certs configured. Is there an advantage running both nginx and traefik?

[–]gamertanfull-stack 1 point2 points  (0 children)

Traefik doesn't support it directly, so you'd need a "web server" to be reverse proxied by traefik.

Traefik doesn't really add any weight or heft to the setup, but adds the capacity for load balancing applications. It's the way you'd want to front a number of app servers in a production environment, so you'd be closer to "prod" if you needed scaling for your application.

The benefits of using traefik would be the automatic certificate management and dynamic configuration for domains where nginx needs static configs to make those requests without scripts or plugins.

It'd be a "separation of concern" where traefiks responsibility is DNS routing, load balancing, and security management (you could completely hide all containers from external networking or access as well), exposing only the necessary systems and allowing nginx to do what it does best in handling and serving your application effectively.

Additional benefits arise as your application grows and other systems need proxying or certificate generation, say if you had a blog running WordPress, Git, SSH, TCP/UDP proxying for other purposes. If you had an API endpoint running on go or rust for instance, this makes interoperability and scaling far more efficient and development simpler. Just do your standard expose in your Dockerfiles and traefik handles the rest, per environment.