The Cinema project can be deployed in a single machine (localhost) in order to know the behavior of microservices.
- Docker 18.06.1-ce
- Docker Compose 1.23.1
We must add virtual domains in order to use each api entry point. By default we are using: movies.local, bookings.local, users.local, showtimes.local and monitor.local
Virtual domains has been defined in docker-compose.yml
file and configured in /etc/hosts
file. Add the following line in your /etc/hosts
file:
127.0.0.1 movies.local bookings.local users.local showtimes.local monitor.local
monitor.local will be used to see the Dashboard created by Traefik.
docker-compose up -d
docker-compose stop
If you need change some source code you can deploy it typing:
docker-compose build
You can start using an empty database for all microservices, but if you want you can restore a preconfigured data execute this step:
Restore mongodb data typing:
This command will go inside the mongodb container (db
service described in docker-compose.yml
file) and will execute the script restore.sh
located in /backup/restore.sh
. Once the script finished the data inserted will be ready to be consulted.
docker-compose exec db /bin/bash /backup/restore.sh
Access to the dashboard to see how Traefik organize the links.
- http://monitor.local : Get Traefik dashboard
Next: Endpoints