Every project — regardless of whether you are working on web app, some data science or AI — can benefit from well configured CI/CD, Docker images that are both debuggable in development and optimized for production environment or a few extra code quality tools, like CodeClimate or SonarCloud. All these are things we will go over in this article and we will see how those can be added to your Python project!

Debuggable Docker Containers for Development

Some people don’t like Docker because containers can be hard to debug or because their images take long time to be built. So, let’s start here, by building images that are ideal for development — fast to build and easy to debug.

To make the image easily debuggable we will need base image that includes all the tools we might ever need when debugging — things like bash, vim, netcat, wget, cat, find, grep etc. python:3.8.1-buster seems like a ideal candidate for the task. It includes a lot of tools by default and we can install everything what is missing pretty easily. This base image is pretty thick, but that doesn’t matter here as it’s going to be used only for development. Also as you probably noticed, I chose very specific image - locking both version of Python as well as Debian - that’s intentional, as we want to minimize chance of “breakage” caused by newer, possibly incompatible version of either Python or Debian.

#development #devops #docker #programming #python

Automating Every Aspect of Your Python Project
2.05 GEEK