Deployment Options
Choose the deployment method that best fits your infrastructure:Docker Production
Deploy the full stack with Docker Compose including Django, PostgreSQL, Redis, Traefik, and Celery workers
Bare Metal VPS
Deploy directly on Ubuntu/Debian servers using Nginx, Gunicorn, and systemd services
Architecture Overview
FootyCollect production deployment consists of these core components:Core Services
| Service | Purpose | Required |
|---|---|---|
| Django + Gunicorn | Application server | Yes |
| PostgreSQL | Database | Yes |
| Redis | Cache and Celery broker | Yes |
| Celery Worker | Background tasks (image downloads) | Recommended |
| Celery Beat | Scheduled tasks | Recommended |
| Nginx/Traefik | Reverse proxy and SSL termination | Yes |
| S3/R2 | Static and media file storage | Recommended |
Requirements
System Requirements
- Docker
- Bare Metal
- Docker Engine 20.10+
- Docker Compose v2+
- 2GB RAM minimum (4GB recommended)
- 20GB disk space
- Ubuntu 20.04+ or Debian 11+
External Services
| Service | Purpose | Required |
|---|---|---|
| Domain name | SSL certificates and production access | Yes |
| SendGrid | Email delivery | Recommended |
| Sentry | Error tracking and monitoring | Recommended |
| AWS S3 or Cloudflare R2 | Static and media file storage | Recommended |
| FKAPI | Football Kit Archive integration | Optional |
Quick Start
Choose Deployment Method
Select either Docker production for containerized deployment or bare metal for traditional VPS deployment.
Configure Environment
Set up production environment variables following the environment setup guide. Generate a secure
SECRET_KEY and configure database, Redis, email, and storage.Deploy Application
Follow the deployment guide for your chosen method. Both guides include database setup, static file collection, and SSL configuration.
Verify Deployment
Complete the production checklist to ensure all security settings are configured and run Django’s deployment checks.
Static and Media Files
In production, FootyCollect serves static and media files from S3-compatible storage:Storage Options
AWS S3
AWS S3
Configure AWS S3 for production static and media files:Static files are uploaded during deployment with
collectstatic.Cloudflare R2
Cloudflare R2
Configure Cloudflare R2 for cost-effective S3-compatible storage:R2 offers free egress bandwidth with S3-compatible API.
Local Storage (Not Recommended)
Local Storage (Not Recommended)
For testing only, you can serve files locally via Nginx:
Security Considerations
Security Checklist
- DEBUG disabled (
DEBUG=False) - Unique SECRET_KEY generated and secured
- ALLOWED_HOSTS configured with actual domain(s)
- SSL/TLS certificates installed
- Firewall configured (UFW or similar)
- Fail2ban enabled for SSH protection
- Strong database password set
- Regular security updates enabled
- Sentry configured for error tracking
- Database backups automated
Monitoring and Health Checks
FootyCollect includes built-in health check endpoints:| Endpoint | Purpose |
|---|---|
/health/ | Basic health check (200 OK if running) |
/ready/ | Readiness check (includes database connectivity) |
Django Deployment Checks
Run Django’s built-in deployment checks before going live:- DEBUG is disabled
- SECRET_KEY is secure
- ALLOWED_HOSTS is configured
- Database connectivity
- Redis connectivity
- SSL/HTTPS settings
- Storage credentials (S3/R2)
Database Backups
Both deployment methods include automatic database backups: Docker: Uses theawscli container for automated backups to S3
Bare Metal: Automated backups during deployment via deploy.sh
Manual Backup
Next Steps
Docker Deployment
Deploy with Docker Compose for containerized production environment
Bare Metal Deployment
Deploy on Ubuntu/Debian VPS with Nginx and Gunicorn
Environment Setup
Configure production environment variables and secrets
Production Checklist
Complete pre-deployment security and configuration checklist
Support
For deployment issues:- Check the troubleshooting sections in Docker or bare metal guides
- Review deployment logs and Django checks
- Open an issue on GitHub