Software Engineer @docker
From a Dockerfile taken "randomly" on Github, like a good old monolith, we will, by applying the best practices, transform this application into a set of reusable and understandable microservices.
We will start by externalizing the services used by our application using existing images and associating them in a Compose file.
We will optimize it by emptying the caches and removing unnecessary layers generated during the build of our application.
We will cut out the different build steps so that we do not have to keep the development dependencies in the final image
We will improve maintainability by using official images rather than manually installing our dependencies.
We will see how to avoid running our application as root.