An example of microservice-based and docker-containerized web backend app
- Product Service (FastAPI,PostgreSQL)
- Order Service (FastAPI,PostgreSQL)
- Run
docker-compose up -d
(orsudo docker-compose up -d
) in the main app directory - App will start only after the databases have been created,after few seconds or so if they havent been (if there are no db service volumes)
- Product Service is on port 8002 -- Product Service Docs
- Order Service is on port 8001 -- Order Service Docs
- Alembic migration tool used for product and order services
- Adding new migration script:
(sudo) docker-compose run <servicename (product_service,order_service)> alembic revision --autogenerate -m "<filename>"
- Running migrations :
(sudo) docker-compose run <servicename (product_service,order_service)> alembic upgrade head
- Authentication
- More services with different frameworks and databases
- Communication between services where necessary (example:updating product quantity when order is made)