Live data from Hacker News

Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

simplecto.com

151–160 of 347 posts

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#151
post #136

Earlier quoted context omitted.

This is a pretty common sentiment on HN and I’m sure you have your reasons for it, but to me personally it just seems bonkers. Docker is an absolutely game-changing tool for me. I can’t count the number of times it’s saved me from completely screwed up system libraries, tools installing config files in weird places, conflicting versions of this or that, or other versions of system pollution. I write a simple docker-c…

Sure, we're all just talking about our personal experiences. I just haven't run into the problems you describe. I use virtual environments to keep my system installation clean, and PostgreSQL / Nginx are so stable that the version I happen to have on my dev machine usually works with all my projects dating back to 2014 (but kept up-to-date).

> Sure, we're all just talking about our personal experiences. I just haven't run into the problems you describe. I use virtual environments to keep my system installation clean, and PostgreSQL / Nginx are so stable that the version I happen to have on my dev machine usually works with all my projects dating back to 2014 (but kept up-to-date).

One of the most important thing docker provides is an abstraction between the application and the OS. If you don't need the abstraction, then it's only going to look like cost.

On the other hand, being able to write an some code in python 3.9 and deploy it anywhere across a heterogeneous production environment without fighting with the OS about how many versions of python it has installed is a useful thing.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#152
post #124

Earlier quoted context omitted.

Venv is great for keeping dependencies separate but if your local machine doesn’t have the same version of Python as your server then you’ll need pyenv.

Not necessarily, you can use a CI pipeline to verify that your project can be build with many Python versions. This is the workflow I use here[0]. It makes catching and fixing breaking changes easier. Plus, I'm confident the core team is not likely to introduce a painful breaking change (think Python 2 -> 3) soon[1] 0: https://github.com/rmpr/atbswp 1: https://mobile.twitter.com/gvanrossum/status/130608247244308...

That's great for libraries but isn't it a pretty huge cost for an app you only really are going to be running on one version at a time?

Dealing with BC breaks for versions you aren't intending to run in production seems like unnecessary overhead.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#153
post #137

Is there a benefit of running Postgres and Django in different containers? By putting them in the same container, things could be a good bit simpler. And I don't see any downside here.

> s there a benefit of running Postgres and Django in different containers

You can use the official optimised containers ( especially for complex things like Postgres that's great)

> By putting them in the same container, things could be a good bit simpler. And I don't see any downside here

The downsides are that you get fat containers that are impossible to scale independently ( one day you might want two Django containers, or to set up a replica PgSQL for load balancing, HA, etc.)

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#154
post #20

Earlier quoted context omitted.

Also, does this becoming accepted bother anyone else? "curl -s https://get.docker.com | sudo bash"

You can also just ignore that and get Docker from your package manager. At least on Debian it's in the official APT repositories and Docker.com hosts one as well.

The version in the official OS-provided repository is often very old, even obsolete. But yeah, just use the Docker provided repository instead, that gets you updates afterwards.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#155

Earlier quoted context omitted.

It’s too fucking hard to setup python with all its pyenv, anaconda, poetry, pip requirements.txt and what-not, that’s the best use case for Docker here. Get it to work once and forget about it.

I also dislike all those tools you mention. So often, I feel like devs use a tool "because it's cool" but fail to appreciate the complexity it adds - not just for themselves but for others. The frustration expressed by your comment is a perfect example of this. In my ideal world, everybody would just use what comes with vanilla Python: python3 -m venv venv source venv/bin/activate (Or `call` on Win) pip install -Ur r…

It's all fun until one of your requirements needs a billion build dependencies to be available on a machine. How do you solve that with pyenv?

Docker does it for you.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#156
post #137

Is there a benefit of running Postgres and Django in different containers? By putting them in the same container, things could be a good bit simpler. And I don't see any downside here.

Docker monitors only main process. If side process fails docker will do nothing about it. Means if you want to put multiple apps inside single container you have to add some manager guy to keep an eye on all the processes (e.g. supervisord).

Plus in case with separate containers the layers cache is reused better.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#157
post #155

Earlier quoted context omitted.

I also dislike all those tools you mention. So often, I feel like devs use a tool "because it's cool" but fail to appreciate the complexity it adds - not just for themselves but for others. The frustration expressed by your comment is a perfect example of this. In my ideal world, everybody would just use what comes with vanilla Python: python3 -m venv venv source venv/bin/activate (Or `call` on Win) pip install -Ur r…

It's all fun until one of your requirements needs a billion build dependencies to be available on a machine. How do you solve that with pyenv? Docker does it for you.

I agree. I suspect Docker does make sense in such projects. In my pretty vanilla web development, I just usually don't experience this.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#158

I don't get why people use Docker for "small SaaS apps" where "scale is not an issue". You can run everything without Docker to remove an extra level of indirection. I've been doing that exact thing with a very similar Django stack for years. Not once have I missed Docker. On the other hand, I have taken over SaaS projects where the (unnecessary) usage of Docker made it more expensive to host, decidedly more difficul…

It’s too fucking hard to setup python with all its pyenv, anaconda, poetry, pip requirements.txt and what-not, that’s the best use case for Docker here. Get it to work once and forget about it.

Few hours of annoyance per developer in the beginning vs. a few minutes every time you run tests or when you debug. Also add in the overhead of configuring a debugging system where you work in an ide and debug code running in a docker image. Doable (though many of my fellow Devs have just given up) but also takes time, probably more than to run pip and get psycopg2 installed on Macs. Also the majority of engineers probably don't even know docker that we'll (definitely far worse than they think they do, just like with k8s). The number of times I've seen Devs running webservers as root in docker containers is amazing.

My team insists on using Docker and against my better personal judgement I let it, but I set up the code to run locally without it. If I call the shots I'll not use docker absolutely.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#159
post #44
post #27

Earlier quoted context omitted.

I think you misunderstood the intent. Constantly optimizing your toolset instead of building a startup with what you already know is a very common form of bike shedding and is one of the hardest things for some developer-founders to get past.

The goal of a startup is to build things quickly, so actually being able to build things quickly is important. If you know a set of tools well you can work quicker than using a perhaps better set of tools that you do not know well. That is an important point to make to people like me who like playing with new toys

I build things quite fast with flask and bootstrap, perhaps now with fastapi. If I have spare time I'd rather spend the time validating ideas or tech in new domains rather than learning more new tech that's just similar to this.

Re: Docker, Django, Traefik, and IntercoolerJS: My go-to stack for building a SaaS

#160

Earlier quoted context omitted.

If you know Docker, and use it daily - it’s a no brainer. For me it’s an easy choice - I dev on a Desktop PC but when I’m on the go I’m on a MacBook. No need to customize environment config with docker. What’s your disaster recovery plan if your server tips over? With docker it’s relatively easy. I’m not saying it’s for everyone, but in my experience it makes my life simpler.

How do you debug (in dev or prod), or in production, do things such as inspecting log files, monitoring system resources, running necessary commands if there is something urgent...? In my experience, Docker just makes everything more tedious without tangible benefits. I personally lose nothing by not using Docker and am much faster in everything I do.

How much experience do you have with Docker? I am not being snarky -- all the things you say sounds like something I would have said until I pulled myself together and learned how to use it properly. And granted, that did take a bit of effort but now my perspective is that Docker is extraordinarily easy to work with.

A Dockerfile is almost exactly like your requirements.txt file, only it works for everything. Need Imagemagick installed on your server? Just add it to the Dockerfile. Need to run a pre-start tool that was written in Ruby? A line or two in the Dockerfile can add that. And if it turns out that you don't want it after all, you just remove the lines and feel confident that no trace is left behind.

Post reply on HN