Live data from Hacker News

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

simplecto.com

231–240 of 347 posts

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

#231

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…

Wow, lots of good questions coming out of this :-)

1. I chose Postgres because I have the need to remotely manage as well as pull metrics into grafana and metabase. That is simply not possible with SQLite.

I realize this post should be a series of posts where I go deep on all parts of the SimpleCTO stack, so to speak.

2. My monitoring is quite limited because. Generally I use netdata to get a quick overview on health, and I export that into grafana. I rely on Hetzner for actual healthcheck and uptime monitoring. Sentry tells me if my code starts throwing too many exceptions or errors.

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

#232

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'm not trying to pick on you personally here but this comment, like many I see on HN, seems overly adversarial and could have made the same arguments in a less combatative way.

There's a lot of emphasis on your own perspective: "*I* don't get", "*I've* been doing that", "Not once have *I* missed Docker", "making *me* less productive", "*my* personal experience*"

And an assumption that it applies to others: "Just use the same [...]", "I feel OP would be better off [...]".

The comment could provoke a more productive, thoughtful discussion by focusing on understanding rather than on pushing particular views and practices.

For example:

- "I don't get why people use Docker" -> "Could anybody share their reasoning for using Docker?"

- "You can run everything without Docker to remove an extra level of indirection" -> "What benefits do you see in exchange for this extra level of indirection?"

- "Not once have I missed Docker." -> "I haven't found much use for Docker and would like to understand those who have"

- "I have taken over [...] making me less productive" -> "I've only encountered downsides in my own experience with Docker, could anybody share what the upsides may have been for others involved?"

- "Again in my personal experience, this simply isn't an issue" -> "I'd be interested to hear more about the benefits as I haven't encountered issues before"

- "In short, I feel OP would be better off without Docker" -> "I wonder if the OP really needs Docker, perhaps they could be more productive without it"

If we all wrote like this (and I'm certainly not perfect myself), HN could be a much friendlier, more welcoming place.

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

#234

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…

I dunno, these magic incantations make a lot less sense to me than:

  pipenv init
  Pipenv install
Maybe it’s because I’m used to npm and composer?

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

#235
post #232

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'm not trying to pick on you personally here but this comment, like many I see on HN, seems overly adversarial and could have made the same arguments in a less combatative way. There's a lot of emphasis on your own perspective: "*I* don't get", "*I've* been doing that", "Not once have *I* missed Docker", "making *me* less productive", "*my* personal experience*" And an assumption that it applies to others: "Just use…

I think I’m fine with the commenter’s style of writing.

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

#236
post #151

Earlier quoted context omitted.

> 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…

To who? Certainly not the vast majority of developers. And if you're using Java/Node/C#/etc? Where all dependencies are included in the compiled output?

I use mostly java, and still prefer java so I can control the jvm parameters and version (compared to managed aws for instance).

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

#237

Nice writeup. What I find lacking in this post is tips on how to best configure systemd to run docker/podman containers and/or docker-compose. Any tips on that would be great!

Thank you! At no point do I have to touch systemd, unless you want to change the default behavior of the docker daemon (which I dont).

You can simply apt-get install docker-compose. I am not familiar with other distributions. I suppose you could also pip install docker-compose as well.

Fortunately most of my systems remain in the default state. All the magic happens in docker/docker-compose.

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

#238
post #125

Earlier quoted context omitted.

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 do you debug (in dev or prod) VSCode lets you debug inside a Docker container. > or in production, do things such as inspecting log files Logs should be sent out of the container, either directly (mount a /logs folder, push them to Sentry / ELK / etc.) or by simply logging to stdout and having Docker send the logs where you want. > monitoring system resources Docker processes are still processes. They show up i…

> VSCode lets you debug inside a Docker container.

Can you connect to a remote host that runs the container?

Docker exec won't work if the container spins into start/fail loop.

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

#239

Earlier quoted context omitted.

OP here, thanks! It is fun to learn, but it sucks to yak-shave [1] all the time. The simplicity of the stack lets me walk away for days (or years) at a time, come back, and easily ship changes. No need to remember esoteric commands, configs, or get bitten by strange infrastructure upgrades. I'm lazy, and I'm just looking for ways to be lazier. :-)

Did you mean to expose your postgres port to the world? Adding the port declaration to the docker file exposes it to other containers on the same network/machine, adding it in docker-compose exposes it to the world.

That is explicit. Now that I think about it, I should update the article with how I do it now.

I explicitly bind the external port only to the ZeroTier interface. In fact, my configs have changed a bit:

instead of:

    ports:
        - 5432:5432
I now use the IP of the zerotier interface:

    ports:
        - 192.168.111.123:5432:5432
Now the only way to reach that port is via the vpn.

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

#240
post #123

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.

>What’s your disaster recovery plan if your server tips over? Git pull, python3 setup_prod.py, pip install requirements.txt Is docker worth not writing the 50 (admittedly unfun) lines of setup?

And you probably have rest of the stuff described in an Ansible playbook, anyway.
Post reply on HN