Skip to content

Feature/add docker#3

Open
DoubleAMJunior wants to merge 9 commits intomohammadsf7293:mainfrom
DoubleAMJunior:feature/add-docker
Open

Feature/add docker#3
DoubleAMJunior wants to merge 9 commits intomohammadsf7293:mainfrom
DoubleAMJunior:feature/add-docker

Conversation

@DoubleAMJunior
Copy link
Copy Markdown
Contributor

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants