Make sure to have docker-compose installed
$ docker-compose --version
cd to this directory and simply run
$ docker-compose up
sit down, relax and watch those beautiful lines on your terminal.
When the build has finished every microservice is up, connected and running, you can access them from browser or postman or whatever
If you need to rebuild everything just run
$ docker-compose build
If you want to rebuild specific microservice
$ docker-compose build dataservice
If you need to change where the docker-compose takes the source files just change the address in the docker-compose.yml
Docker is fun but it creates a lot of garbage so runs this command to remove everything you have created
- Remove Containers: Not very much space reclaimed but you also don't lose much
- A container is created from an image,
docker-compose up
use the same created containers insteaddocker run
creates a new container each time you use it
$ docker container rm $(docker ps -aq)
- A container is created from an image,
- Remove Images: Images occupy a lot of space mostly because of the images of python.
- Removing all the images comports that
docker-compose up
has to download and create again every image from scratch
$ docker rmi $(docker images -aq)
- Removing all the images comports that
- Remove Volumes: Every image with a database use a volume for persistance, it's not much but why not
$ docker volume rm $(docker volume ls -q)
- Remove Networks: The docker compose created use a shared network between the microservices let's remove also that
$ docker network rm $(docker network ls -q)