Logo do Projeto

GitOps-Powered Minecraft Server

A fully automated, secure, and scalable Infrastructure as Code (IaC) solution for deploying a production-ready Minecraft server on GCP.

Status Ativo Licença MIT GitHub Stars

✨ Key Accomplishments

This project isn't just a concept; it's a fully functional, production-ready system built on modern DevOps principles.

✅ End-to-End Automated Pipeline

The core CI/CD workflow is fully functional and deploys changes on push to main.

✅ Secure IaC Foundation

Infrastructure is managed by Terraform with integrated security scanning (Trivy).

✅ Remote State & Locking

Collaborative and safe state management is in place using Google Cloud Storage.

✅ Keyless GCP Authentication

Secure connection between GitHub and GCP is established via Workload Identity Federation.

🏛️ Architecture Details

The architecture is designed for automation and scalability, divided into three main layers that work in concert: Infrastructure, Application, and the CI/CD pipeline that orchestrates them.

1. Infrastructure Layer

Managed by Terraform, this layer provisions all necessary GCP resources like VPC, Compute Engine VMs, GCS Buckets for state and backups, and secure IAM roles.

2. Application Layer

The Minecraft server (PaperMC) and proxy (Velocity) are containerized using Docker and orchestrated by a docker-compose.yml file for consistency and isolation.

3. CI/CD & GitOps Layer

GitHub Actions connects the code to the cloud. A `git push` triggers a pipeline that validates, scans, plans, and applies changes to both infrastructure and application layers.

🔌 Player Connection Flow

The use of a Velocity proxy is a key feature for security and scalability. It acts as a secure gateway, hiding the main server and allowing for future expansion into a multi-server network.

Player

Minecraft Client

GCP Firewall

Allows Port 25565

Velocity Proxy

Docker Container

PaperMC Server

Docker Container

🗺️ Roadmap & Future Enhancements

With a solid and secure foundation, the next steps focus on professionalizing the development workflow and adding advanced operational capabilities.

🗓️ `[To Do]` Implement a Pull Request Workflow

The highest-priority next step. This involves protecting the `main` branch and modifying the pipeline to run `terraform plan` on Pull Requests for team review and validation.

🗓️ `[To Do]` Refactor to a Reusable Terraform Module

Abstract the Minecraft server resources into a dedicated, reusable Terraform module to make the code cleaner and allow for easy creation of multiple environments.

🗓️ `[To Do]` Advanced Observability

Deploy Prometheus & Grafana alongside the server to collect and visualize detailed, real-time in-game metrics (TPS, player count, memory usage) on beautiful dashboards.

🗓️ `[To Do]` Serverless Operations

Automate maintenance tasks like nightly backups and create intelligent alert notifications to Discord or Slack using a serverless architecture with Cloud Functions.

🤝 Contributions & Contact

Contributions are welcome! Feel free to open an issue or submit a pull request.