Open
Conversation
Adds docker compose file to easily run the project and docker files for the Matchmacking.Net and Matchmacking.Console projects
Changes the program.cs from MatchMaking.Console to also load configurations from environment variables
Updates program.cs from MatchMaking.Net to use Environment variables for configurations. Helps with setting up the container if not available it will fall back to previous behavior and it will not change any of the functionalities
Adds support for running database migrations automatically on container startup. Includes a retry mechanism to handle cases where the database is not immediately available when the container starts.
Adds health check for the mysql server and makes sure the dependent containers run after mysql is active
Fixes the entry point for the MatchMaking.Console app ensuring it will run every 60 seconds after starting the container using docker compose
mohammadsf7293
approved these changes
May 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces Docker support for the application, enabling easier setup and consistent local development and deployment environments. Key changes include:
Added
docker-compose.yml for orchestrating multi-container setups (webapp, worker, mysql).
Dockerfiles for Rovio.MatchMaking.Net (webapp) and Rovio.MatchMaking.Console (worker).
Health checks for MySQL service to ensure service dependencies initialize correctly.
Updated
Application configuration loading to support environment variables via .NET configuration binding.
Connection string and other values are now read from ConnectionStrings__DefaultConnection and other relevant environment keys.
Web and Worker project Program.cs updated to:
Automatically apply pending Entity Framework Core migrations on startup.
Log relevant startup lifecycle events more cleanly.
Worker Container
Configured to run continuously using a shell loop:
Ensures matchmaking logic is periodically executed and container stays alive.
Benefits:
Simplifies local development by using containers for DB and services.
Reduces manual DB migration management.
Provides a clean separation of concerns between API and background worker.