A containerized 2048 game deployed on AWS ECS Fargate with complete CI/CD automation using GitHub Actions.
- Frontend: HTML/CSS/JavaScript 2048 game
- Container: Dockerized with Nginx
- Infrastructure: AWS ECS Fargate with Application Load Balancer
- CI/CD: GitHub Actions for automated build, test, and deployment
Add these secrets to your GitHub repository:
AWS_ACCESS_KEY_ID
- Your AWS access keyAWS_SECRET_ACCESS_KEY
- Your AWS secret keyAWS_ACCOUNT_ID
- Your AWS account IDAWS_REGION
- AWS region (us-east-1)DOMAIN_NAME
- Your domain (fozdigitalz.com)SUBDOMAIN
- Game subdomain (play-2048)ECR_REPOSITORY
- ECR repo name (2048-game)ECS_CLUSTER
- ECS cluster name (2048-cluster)ECS_SERVICE
- ECS service name (2048-service)ECS_TASK_DEFINITION
- Task definition name (2048-task-def)CONTAINER_NAME
- Container name (2048-container)VPC_ID
- Your existing VPC IDCERTIFICATE_ARN
- Your ACM certificate ARNHOSTED_ZONE_ID
- Your Route53 hosted zone ID
- Route53 hosted zone for
fozdigitalz.com
- ACM certificate for
*.fozdigitalz.com
in us-east-1
Push to main branch to trigger automatic deployment.
cd terraform
terraform init
terraform plan
terraform apply
# Run tests
npm test
# Start local server
npm start
# Visit http://localhost:8000
# Build Docker image
docker build -t 2048-game .
docker run -p 8080:80 2048-game
Once deployed, access your game at: https://play-2048.fozdigitalz.com
- Use arrow keys to move tiles
- Combine tiles with same numbers to reach 2048
- Click "New Game" to restart
- ECR: Container registry
- ECS Fargate: Serverless container hosting
- ALB: Load balancer for high availability
- VPC: Isolated network environment
- CloudWatch: Logging and monitoring
- Test: Validates game logic
- Infrastructure: Deploys/updates AWS resources via Terraform
- Build: Creates Docker image
- Push: Uploads to ECR
- Deploy: Updates ECS service
The pipeline automatically deploys on every push to the main branch with HTTPS support and custom domain.