Building a Microserviecs using Flask
- Udacity Course:
- https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615
- (This is a free course)
- Python
- Flask
- Docker
This consists of 2 sevices:
- hello_world_service
- ping_service
3000
Returns: Hello, World!
http://127.0.0.1:3000/
python services/hello_world_service/app.py
3001
Returns: Pong
python services/ping_service/app.py
Inside the folder of each service, there is a file called:
image_builder.sh
When you double click this file , the image will be generated.
Go to this directory:
Docker/containers
There you will find these files:
- container_builder__all.sh
- This builds the containers of the images ofthe services
- container_builder_hello_world.sh
- This builds the container of service of the hello_world image
- container_builder_ping.sh
- This builds the container of service of the ping image
In the same directory, as the previous article.
Docker/containers
There you will find these files:
- container_deleter_all.sh
- deletes all the containers related to the services
- container_deleter_hello_world.sh
- deletes the hello_world service container.
- container_deleter_ping.sh
- deletes the ping service container.
Inside the folder Docker, there are 3 files:
- compose.sh
- Double clicking this file will compose the services
- docker-compose.yml
- This file contains the compose specifications
- container_deleter__all.sh
- Double clicking this file will delete all the compose containers
Now using your browser, check these links:
- http://127.0.0.1:3000/
- The response will be : Hello, World!
- http://127.0.0.1:3001/ping
- The response will be : Pong