Hey everyone! I'm relatively new to Docker, having just learned about it in my university course last week. I get the basics about containerization and the advantages like debugging and consistency. However, I'm a bit unsure about when to actually start setting up my project in Docker. In my class, we're working on a microservice project which consists of 7 microservices that I've developed. Some of them still need adjustments, and there are 3 that I'm waiting for my teammate to complete. Should I create a Docker image now, or is it better to wait until all the microservices are done? Can I also add and update the microservices in Docker later? Thanks for any advice!
5 Answers
You don't need to wait to port things over to Docker. It's a good idea to start using Docker Compose right away during your development process. You’ll save yourself a lot of hassle later on!
For development, I’d suggest adding the Dockerfile and Compose file as soon as you can run a build command. It helps standardize your build process without needing to install everything locally. Plus, using multi-stage builds keeps your final images small and efficient!
Yeah, the watch directive in the Compose file is super useful! You’ll be able to run 'docker compose up -d' and see changes in real time.
Honestly, it’s possible to do it either way, but deploying your project as a Docker container is beneficial. It helps eliminate any "it runs on my computer" dilemmas, so it makes sense to dive into Docker sooner rather than later.
Docker is great for trying things without traditional installs. It keeps everything encapsulated! Once you start using it, you'll understand why it's so powerful.
There are definitely scenarios where starting ASAP makes sense. In my experience, getting the Docker file done early in your service development is standard practice.

I had no idea about multi-stage builds before! Thanks for the advice.