A simple school projet to mimic steam - Docker compose stack
This docker compose project has the following profiles:
- postgres (for all databases in this project)
- kafka (to initialize the cluster)
- ksqldb (to initialize ksqldb for the cluster)
- publishers (for all publisher related images)
- platform (for all platform related images)
- players (for all players related images)
- all (to start/stop everything)
First initialize the postgres databases:
docker compose --profile postgres up -dThen just initialize the Kafka cluster:
docker compose --profile kafka up -dNow you have everything needed to run the other images that would listen to the published topics ! Check details for ksqldb specific instructions.
To stop everything, just use:
docker compose --profile all downThe following apps:
can be connected to this stack. Use the following command and adjust if needed:
docker run --rm -it --network kafka-net -e SPRING_DATASOURCE_URL=jdbc:postgresql://pub-db:5432/pub --name pub-app ghcr.io/mortell560/pub-app:latestCheck the relevant repositories for more info...
Take note that the platform-app is already provided to you through the all profile. You can check the platform service declared within the docker-compose.yml
Important: take note that you can edit every topic and group-id that an app uses through environment variables or Spring Boot configurations with keys such as CLI_GROUP or TOPIC_USER_TO_REGISTER... Edit if needed.
In this docker compose stack, you will find a few folders:
- scripts (for all schema registry and kafka-connect actions)
- schemas (which contain all AVRO schemas used in this project)
- kafka-connect/plugins (contains all the Apache Kafka Connectors used in this project)
- ksql (for all "SQL" scripts intended for KSQLDB)
Important note: ksqldb may be a bit picky and may not start with the entire cluster. You can start it later on with:
docker compose --profile ksqldb up -dIf you still don't see any stream and table within Kafka UI declared for KSQLDB, try again to initialize it:
docker compose --profile ksqldb up -d ksqldb-init- Please start Ksqldb ONLY when you have already published a game and you are about to buy a game. There's a mismatch in the schemas that ksqldb tries to declare and the Kafka Connectors AVRO schema's (public.games.first-games-price topic). There are no issues if you launch KSQLDB after the schema has been declared already by Kafka Connect.