Local development setup with or without Docker

Hi there!

We’ve been using Docker Compose for local development for a few months now. It has worked great at getting new developers up and running quickly, and is working ok overall. We are experiencing a few annoying quirks, though the specifics are not too important. Does anyone have any recommendations on the best local environment setup for development across a team? We’ve seen good things from Docker, but we’re open to almost anything. Thanks!

I can’t speak for “best”, or even “optimal” for that matter, but I can tell you about us. We have a small team (two full-time working on Django-related projects) but use multiple methods:

At any given time, I may be doing development in:

  • Native Windows
  • WSL 1 (When IPv6 is needed)
  • WSL 2 (No IPv6 available)
  • Local VirtualBox VM
  • On a remote server (either physical or virtual)

However, at no time are either of us directly doing development within a Docker container. We do have a couple of systems (4 or 5?) that are deployed into Docker, but the development for them is all done outside the container environment.

What ties all this together for us is Visual Studio Code. Its ability to work well in “remote” environments has been the key in being flexible on this. (Not all of our deployment targets are x86-class servers. We’ve done some work on ARM-based systems - think Raspberry Pi type devices.)

IMHO it all depends of what kind of software you develop. If you are coding something that you can control from develop to deployment you can get married with your OS package manager. For example, I have make a couple of projects with a very strong opinionated stack, Ubuntu 20.04 and all that come with its APT package manager, that is PostgreSQL 12, Python 3.8, git, etc. Pip makes all the work of dependencies in the Python ecosystem inside a virtual environment (pyevn is a great tool if you want to target multiple Python versions)

After that I deploy the software in the same OS and I just need a few lines in order to have the same packages and versions, with the great advantage of let the Canonical team in charge of patches.
By the way, I use this workflow in WSL 2 in my laptop, a Xubuntu Desktop and Ubuntu Server for deployment.

Now, if you are a multi OS team, that could be a big problem, but I think the convention over configuration it is a good approach for developer teams.

I find Docker is great for portability and getting up and running quickly, but frustrating as a long-term development experience.

My favorite way to do cross-team development is to run all services (e.g. Postgres, Redis, etc.) in Docker, but then also expose them on the host machine so that you can run your actual Django app on either Docker or directly on your machine. I find I almost never run into docker-specific issues related to services, but do run into them when running the Django portion (e.g. debugging is annoying).