DEV Community

Development environment with Docker and Traefik

Flemming on November 26, 2020

The Problem Local development with docker is nothing new. Run a local container export some ports and here we go. But I ran into the pro...
Collapse
 
mrwormhole profile image
Talha Altınel • Edited

That's just very cool, i actually use nginx-reverse-proxy companion for my projects but i liked the observability dashboard on traefik a while ago but i didn't know about traefik pilot dashboard, there is not even a configuration file like nginx.conf, everything is in docker compose file i love it!

Collapse
 
flemming profile image
Flemming

Exactly the reason why I use I. No big configuration.

Collapse
 
haofuxin profile image
Fuxin Hao

Thanks for your awesome article. But I still have a problem, what if some domain/port in third-parties SDKs are hard-coded. for example api.abc.com:1080 is hard-coded in a thrid-party SDK. how can I reroute it to myproject.localhost:80? the only thing I can think of is using something like iptables and editing /etc/hosts. Do u have some better ideas?

Collapse
 
flemming profile image
Flemming

I don't have a good solution for this. I think your way is the most simplest one.

Collapse
 
a_regularjeff profile image
Jeff

Looks really amazing, I'm gonna start using it on my projects to see how it goes. Thanks for sharing!

Collapse
 
patricia_dugan profile image
patricia_dugan

Hi Flemming. I'm Patricia, Head of Community for Traefik. We'd like to invite you to become a Traefik Ambassador, as a contributor of code/content/community. We'll send goodies, invite you to the Traefik Ambassador Discord server, and also invite you to special Traefik Ambassador only events. Fill out the content sector here, and we'll get started! Thank you. info.traefik.io/traefik-ambassador...

Collapse
 
imthedeveloper profile image
ImTheDeveloper

I use traefik on most of my projects now and it's an absolute dream to work with. Highly recommend giving it a go before battling with nginx etc.

Collapse
 
flemming profile image
Flemming

Yes specially if you are hosting you services with docker. It is the perfect match. And you don't have to worry about Let's Encrypt certificats.

Collapse
 
michabbb_76 profile image
Michael Bladowski

how do you handle HTTPS in that scenario?

Collapse
 
flemming profile image
Flemming

I don't really need https for local development. But one possibility is to create a wildcard certificate for *.localhost and trust the CA by putting it in the local truststore.Then you have to extend traefik with the access point 443.

Collapse
 
michabbb_76 profile image
Michael Bladowski

i guess the best way (for me) is to find a simple free dns provider that is supported by letsencrpyt... so I don´t have to expose my ports or open and firewalls for the HTTP challenge....