Live data from Hacker News

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

simplecto.com

201–210 of 347 posts

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

#201

Earlier quoted context omitted.

Everything you write is possible, but - and again in every single step of your daily dev work - more tedious than doing things directly. It's just not worth it for me. But it also sounds like you are operating within a larger organization. So your requirements may be different from mine.

It's not tedious at all and it saves potentially blowing up your system with crap splattered all over your filesystem. We have tons of WSL2 devs and Linux people and it takes care of the, "it works on my machine" problem once and for all. This insistent push that the old way was good and why did we expend all this effort to make a new thing that I don't want to bother learning the five new invocations to just doesn't…

(Edited to remove a snarky comment I made.)

"New is good" is also no general justification. It always depends on the context. Several replies in this thread mention very good use cases where Docker makes sense. From what you wrote, it sounds to me like it also makes sense in your environment.

Yes I mean I don't want to have to learn things that don't bring me value. But it's not about learning the commands. It's about having to repeat them over and over again in my daily work. About the associated mental burden "am I in the container now? Is it running?" And about everything taking longer, be it running tests in Docker or pushing to a registry and waiting for the new container to be spawned. As a single dev, and I feel this is where your and my requirements differ, it simply is not worth it.

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

#202

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…

I had great use of Docker even in my personal RPI projects, as Python modules can be difficult to get compiled and in a usable state on raw Raspbian. In projects at work I personally only recommend Docker when we need Hyper-V isolation or K8s is hosting the product (these are .NET projects, which work really well when published as self-contained binaries).

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

#203

Great writeup! I think it's useful to talk more about complete stacks instead of focusing on individual parts without mentioning the "glue" between them so I really like these kinds of posts. Just two questions: 1. If you're not going for scalability why Postgres and not SQLite? 2. What does your monitoring look like? I've read something about Grafana and Hetzner dashboards in the comments but what exactly do you use…

I love SQLite, but it really doesn't have a great answer to HA/failover. If you enable WAL mode, even NFS is off the table.

This brings to mind a question: would it be possible to run simply run multiple instances of SQLite on independent hosts that are backed by single shared filesystem, such as AWS's EBS? Of course they'd be blocked on writes but it does seem that SQLite3 supports the read concurrency.

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

#204

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…

At work I had to set up a server with django, postgres, SSL, rabbitmq, celery and a few other things. I did it in both ansible and docker-compose, the ansible version was 1500 lines and docker-compose version was 100 lines. A lot of the ansible stuff is dealing with users, groups, services, supervisord, virtualenvs and repositories - none of this is required in docker as containers restart themselves, users are already set up, you don't need virtualenv, and using containers avoids the need to use repositories to get specific software versions. Also the docker-compose version was much faster to pick up changes, vs minutes for ansible.

I don't find docker that useful for developing on a day to dat basis however, it just gets in the way and generally you're not going to need a webserver, SSL, celery, rabbitmq in development anyway. It is useful to debug things locally though.

The other reason to use docker is state: while using ansible we got bitten by old dependencies hanging around because ansible doesn't exactly mirror your config, it can really only add stuff. Whereas docker actually wipes the slate clean every single deploy so your server is an exact mirror of your docker-compose file. This is really important.

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

#205
Docker, traefik and debian auto-update alone allow me to run all my side projects on a single semi-beefy machine i pay I like to try new JS technologies and those alone sometimes need different node versions - i would hate to spend time on these issues.

My deployment is 2 lines: DOCKER_HOST=ssh://user@mydomain.com docker-compose up

Did not have to touch it for years

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

#206
post #144

Earlier quoted context omitted.

It's a really fat binary that adds unnecessary layers in both dev and prod. In dev, it's faster to run tests and easier to debug without Docker. And in prod, why use a vm inside a vm?

> In dev, it's easier to debug without Docker. And in prod, why use a vm inside a vm? On the contrary, it's easier to debug with Docker - it eliminates dangling system level libraries / old dependencies / cache, and everything is self-contained. If you have the problem in dev, you'll have it in prod as well. Docker is not a VM, it's basically a big wrapper around chroot and cgroups, the performance hit is minimal. Th…

This is wrong. Docker is a VM on Windows at least.

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

#207
post #205

Docker, traefik and debian auto-update alone allow me to run all my side projects on a single semi-beefy machine i pay I like to try new JS technologies and those alone sometimes need different node versions - i would hate to spend time on these issues. My deployment is 2 lines: DOCKER_HOST=ssh://user@mydomain.com docker-compose up Did not have to touch it for years

Except for the traefik v2 upgrade, forgot to mention that. But aside from that no work whatsoever.

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

#208
post #128

Earlier quoted context omitted.

How many scenarios do you typically need to spin up your environment in? I achieve the same (defining the environment) by pinning Python dependencies via requirements.txt and virtual environments. And I have an installation script, like a Dockerfile but just an executable bash script, that installs PostgreSQL etc, pulls the code from GitHub and starts up the server. I can upload this to a clean Debian installation to…

> I don't. I just use one $5 per month Linode for each SaaS Well then you're basically using VMs as your containerization mechanism, with install scripts replacing Dockerfiles. So from your perspective, don't think of Docker as a really fat binary. Think of it as a stripped-down VM that doesn't cost a minimum of $5 per instance, and comes in a standardized format with a standardized ecosystem around it (package regis…

I use Ansible instead Docker. It make no sense to use Docker at all. Ansible take care of all.

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

#209

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…

I feel OP would be better off with Ansible.

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

#210
Lots of discussion around Docker here. I use some glue shell scripts to deploy Docker containers to prod as I think Kubernetes is overkill. I have however been considering podman and starting the containers from systemd which would be a very small leap.

Is this a good solution for small prod setups?

Would like to hear experiences.

Post reply on HN