This congolmerate of services realizes a simple service oriented architecture of a lottery. Three main actions are available for execution:
/add_bet
- a customer can register their own bet by supplying it to the endpoint/trigger_draw
- a draw for the winning-numbers can be initiated/show_result
- the results expressed by an attributewinning_class
shows for each bet their profit
To test out each deployment some example calls are provided and documented in the example_call directory.
-
Two services with one having a persistence layer
customer_service is realized with a persistence layer in the form of NoSQL MongoDB-Datenbank with a corresponding adapter
-
One of the service is realized with a hexagonal architecture
-
How to install the application in a VM
-
Dockerfiles and their execution strategy
- drawing_service
- customer_service
- docker commands for infrastructure components see here
- MongoDB
- RabbitMQ
-
Docker Compose of entire application, execution strategy, NGNIX as load balancer
-
Kubernetes Manifeste
-
Automated Buildpipeline
The build pipeline is realized with GitHub-Actions. The needed steps are described in the github-workflows. Their history of execution and builds can be seen here.
- Install Python Install Python according to the offical documentation in version 3.9
- Install MongoDB according to the official documentation
- Install RabbitMQ according to the official documentation
- Install the application - Move the source code or artifacts into the ROM of the VM by cloning the repository or moving them manuall
- Setup the configuration for each of the sub-applications which in this project is done by passing or setting environment variables. Make sure the separate applications are reacheable by eachother for communication
- Execute all the single parts in separate processes
- MongoDB instance
docker run -p 27017:27017 \
--rm \
--env-file ../.env \
--name mongodb \
--mount source=cnd_mongodb_data,target=/data/db \
--network=lotto_local \
mongo:6.0.3
- RabbitMQ instance
docker run -it \
-p 5672:5672 \
-p 15672:15672 \
--rm \
--mount source=cnd_rabbitmq_log,target=/var/log/rabbitmq/ \
--mount source=cnd_rabbitmq_data,target=/var/lib/rabbitmq/ \
--network=lotto_local \
--name rabbitmq \
rabbitmq:3.9-management