Overview
The Tournament Management App is fully containerized using Docker, enabling consistent deployments across development, staging, and production environments. The application uses a multi-stage Docker build to create optimized production images.Prerequisites
Docker Engine
Version 20.10 or higher
Docker Compose
Version 2.0 or higher
Quick Start with Docker Compose
The fastest way to deploy is using Docker Compose:1
Clone the repository
2
Build and start the container
- Development
- Production
- CI Environment
http://localhost:5000 with Development environment settings.3
Access the application
- Development: Navigate to
http://localhost:5000 - Production: Navigate to
http://localhost:80
4
Verify health
Check the application health endpoint:You should receive a
Healthy response.Docker Compose Configuration
Development Environment
docker-compose.yml
The Development configuration enables detailed error pages, developer exception pages, and hot reload capabilities.
Production Environment
docker-compose.prod.yml
Dockerfile Structure
The application uses a multi-stage build for optimal image size and security:Stage 1: Build
Dockerfile (Build Stage)
- Uses the full .NET SDK (8.0) for compilation
- Installs Entity Framework Core tools
- Creates a solution and adds all projects
- Restores NuGet dependencies
- Builds in Release configuration
- Runs migrations for both database contexts
- Publishes the optimized application
- Cleans up unnecessary files to reduce image size
Stage 2: Runtime
Dockerfile (Runtime Stage)
- Uses the lightweight ASP.NET runtime (no SDK)
- Copies only the published application
- Includes the pre-initialized SQLite database
- Exposes port 80 for HTTP traffic
- Configures the entry point for the web application
Container Management
View Running Containers
View Container Logs
Stop the Container
Restart the Container
Execute Commands Inside Container
Building Custom Images
If you need to customize the Docker image:Environment Variables
You can override environment variables in docker-compose.yml:For SQLite databases, the connection string should point to a file path. For SQL Server, use a full connection string with server, database, and credentials.
Data Persistence
The SQLite database is created inside the container at/app/Torneo.db. To persist data across container restarts, you can mount a volume:
Cloud Deployment
The application includes arender.yaml configuration for deployment to Render.com:
render.yaml
Render
One-click deployment from GitHub
Azure
Azure Container Instances
AWS
Amazon ECS or App Runner
Troubleshooting
Container fails to start
Container fails to start
Solution: Check container logs for errors:Common issues:
- Port 5000 or 80 already in use
- Insufficient memory or disk space
- Database migration failures
Database not initialized
Database not initialized
Solution: The Dockerfile runs migrations automatically during build. If the database is missing:
Application returns 502/503 errors
Application returns 502/503 errors
Solution: Ensure the container is healthy:If unhealthy, check that the database is accessible and properly initialized.
Changes to code not reflected
Changes to code not reflected
Solution: Rebuild the image after code changes:
Next Steps
Database Setup
Learn about database configuration and migrations
Configuration
Configure environment variables and settings
Managing Teams
Start managing your tournament teams
User Authentication
Set up user accounts and permissions