The aims of this repository is used the stack with python (FastApi) , PostgresSql and nginx as load balancer and server reverse proxy.
The API have the capability to manage the Hero, an Hero has the follow parameters
- id
- name
- secret_name
- age
The Api has 3 endpoints
/
=> health check- POST
/heroes/
=> create a new hero - GET
/heroes/
=> get the heroes
The project has an integration with docker compose, see more in the docker-compose.yml file.
- Postgres SQL, image.
- ms_hero_1, api image.
- ms_hero_2, api image.
- server_reverse_proxys, nginx image, the nginx conf file is at the follow path
reverse_proxy/nginx.conf
.
The load balancer is configured to send a request to each ms_hero follow least connection.
This repository used docker as container manager
docker-compose build
docker-compose up -d
or if you want to use a simplified command line
docker-compose up -d --build
- FastApi as Rest API framework.
- Docker as container manager.
- PostgresSql as DataBase.
- Nginx as load balancer and reverse proxy.
[1] Simic, S. (2023) How to install Docker on ubuntu 20.04 and 22.04, phoenixNAP. Available at: https://phoenixnap.com/kb/install-docker-on-ubuntu-20-04 (Accessed: 21 September 2023).
[2] Maintainers, D. (2023) Install the compose plugin, Docker Documentation. Available at: https://docs.docker.com/compose/install/linux/ (Accessed: 21 September 2023).
[3] taoyuan. (n.d.). Generation of a self signed certificate. Gist. https://gist.github.com/taoyuan/39d9bc24bafc8cc45663683eae36eb1a
[4] Ramírez, S. FastAPI [Computer software]. https://github.com/tiangolo/fastapi