This project aims to demonstrate how to properly use Docker for any kind of project.
It contains 3 services:
- Blog (Rust)
- Catalog (Node.js)
- Restaurant (Php)
For each service, there is a development and production environment, and a CI pipeline to make sure everything is building correctly.
Docker is a powerful tool, but it can be hard to use properly.
Here are some good practices we followed:
- Use multi-stage builds to reduce the size of the final image.
- Use
.dockerignore
to avoid copying unnecessary files. - Don't use
latest
tag for images, use a specific version instead. - Don't use
root
user in your container, use a non-root user instead. - Use environment variables to configure your application.
- Optimize layers cache by ordering your commands.
- Use
HEALTHCHECK
to check if your application is running correctly.
Learn more about good practices in the Docker documentation.