Live data from Hacker News

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

simplecto.com

191–200 of 347 posts

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

#191

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.

Is it? I've been riding on bare virtualenv and pip since around 2014, maybe longer. Inside containers and without Docker alike.

Same. The only issue I had with virtualenv was when I copied one to a different directory and it didn't work. It turns out you can't do that. Everything else has always worked fine, and I've been using it professionally for 10 years.

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

#192

Earlier quoted context omitted.

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

I don't have a lot of experience with Docker, but it's not what's holding me back. Here are some of my pain points: 1) Having to "docker exec" to get a shell in a running container vs just running the command (in dev) or sshing into the server (in prod). 2) Tests taking 3:30 min to run with docker vs 30 secs without. And then of course, you don't just run tests once but many times, leading to tens of minutes on a giv…

> 2) Tests taking 3:30 min to run with docker vs 30 secs without.

This is not a problem with docker, but your environment. Tests should run at the same speed and initial time with or without docker (with an exception for changes that update dependency list - that will take the time for the initial build).

Things to check: Are you installing dependencies before adding the app? For development are you mounting the app instead of building a new image each time?

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

#193
post #125

Earlier quoted context omitted.

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

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 line up with the needs of today.

Docker pull, docker exec, docker ps, docker logs and you've pretty much got what you need for ninety percent of your job.

This stuff is not hard. You make it hard for yourself by digging in.

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

#194

Can anyone answer why python is a choice anymore instead of i.e. golang for saas applications like this? I previously worked heavily with ruby and I cannot imagine building beyond >1000 LoC in interpreted, dynamically typed languages. Aside from developer familiarity which trumps all other points. It's also significantly easier to dockerize a generated binary from golang or rust, etc. Some of my worst docker headache…

What's the Django/Rails equivalent in Go? The value from Python isn't Python itself (though it might be easier to write in - trading off reliability for ease of use compared to a compiled language) but the ecosystem. Fully-featured frameworks such as Django, Rails, etc give you lots of functionality out of the box which is very valuable especially at the early stages of the project where performance isn't a concern y…

I think if you're using Htmx/Intercooler with Golang, you'd probably want to take a different approach from Django anyway. The backend design approach has to change slightly. You're focused less on whole pages and more on individual user interactions.

There's room for a tool that will scaffold a Go backend from an Htmx-ified web page IMHO.

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

#195

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…

> You can run everything without Docker to remove an extra level of indirection.

... and add questions like: are all paths correct for this machine, are binary lib dependencies the same as in production, are the OS versions compatible between dev and prod, is my local runtime version compiled with same options?

The great example where the indirection adds value is: every developer has the same environment and the CI is the same, regardless of personal preferences in systems.

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

#196

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…

and pipx for managing python "apps" like youtube-dl, ipython, meson, ... https://pipxproject.github.io/pipx/

I prefer my system for running youtube-dl in an isolated environment without having to install all of its dependencies on the host. Ansible writes a bash script at ~/bin/youtube-dl containing:

  #!/usr/bin/env bash
  set -e

  IMAGE_NAME="grepular/youtube-dl"

  # Build the image if it does not exist
  if [[ $(podman images --filter "reference=$IMAGE_NAME" -q) == "" ]]; then
      podman build -t "$IMAGE_NAME" -&2
  FROM python:3-slim
  RUN python3 -m pip --no-cache-dir install youtube_dl
  ENTRYPOINT ["youtube-dl"]
  EOF
  fi

  podman run --net host -i --rm -v "$PWD:/app" -w /app "$IMAGE_NAME" "$@"

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

#197

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…

> You can run everything without Docker to remove an extra level of indirection. ... and add questions like: are all paths correct for this machine, are binary lib dependencies the same as in production, are the OS versions compatible between dev and prod, is my local runtime version compiled with same options? The great example where the indirection adds value is: every developer has the same environment and the CI…

If you have to answer such questions then yes, Docker is probably a good solution for them. I find that in my pretty vanilla web development, I am not faced with those questions. Most of my stuff is just Python, Django, PostgreSQL, Nginx and a few not very exciting Python dependencies. (This is in several independent projects, working as a sole developer, since 2014 and let's say ~100.000 users of my SaaS apps.)

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

#199

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…

Allow me to offer a counterpoint. Docker is useful for reasons besides scale. It allows you to (kind of) declaratively define your environment and spin it up in any number of different scenarios. It allows you to ship all your dependencies with your app and not worry about getting the host machine properly configured beyond setting up Docker and/or Kubernetes. Have other apps you want to host on the same set of machi…

This is absolutely the case. IMO the main benefit provided by containerization is reproducibility. Scaling and other positives are just a product of this.

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

#200

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…

> You can run everything without Docker to remove an extra level of indirection. ... and add questions like: are all paths correct for this machine, are binary lib dependencies the same as in production, are the OS versions compatible between dev and prod, is my local runtime version compiled with same options? The great example where the indirection adds value is: every developer has the same environment and the CI…

Docker uses the host kernel. To get everything identical you need to use a VM anyways.

Some languages bundle all of their dependencies so you can be relatively sure they will run the same on prod. For others (Python, Ruby) that use many system libraries, containers may add value

Post reply on HN