Skip to main content
FootyCollect can be deployed to production using either Docker Compose or directly on a VPS (bare metal). This section guides you through both deployment methods, environment configuration, and production best practices.

Deployment Options

Choose the deployment method that best fits your infrastructure:

Architecture Overview

FootyCollect production deployment consists of these core components:

Core Services

ServicePurposeRequired
Django + GunicornApplication serverYes
PostgreSQLDatabaseYes
RedisCache and Celery brokerYes
Celery WorkerBackground tasks (image downloads)Recommended
Celery BeatScheduled tasksRecommended
Nginx/TraefikReverse proxy and SSL terminationYes
S3/R2Static and media file storageRecommended

Requirements

System Requirements

  • Docker Engine 20.10+
  • Docker Compose v2+
  • 2GB RAM minimum (4GB recommended)
  • 20GB disk space
  • Ubuntu 20.04+ or Debian 11+

External Services

ServicePurposeRequired
Domain nameSSL certificates and production accessYes
SendGridEmail deliveryRecommended
SentryError tracking and monitoringRecommended
AWS S3 or Cloudflare R2Static and media file storageRecommended
FKAPIFootball Kit Archive integrationOptional
Domain Required: You need a domain name for SSL certificates. Let’s Encrypt cannot issue certificates for IP addresses.

Quick Start

1

Choose Deployment Method

Select either Docker production for containerized deployment or bare metal for traditional VPS deployment.
2

Configure Environment

Set up production environment variables following the environment setup guide. Generate a secure SECRET_KEY and configure database, Redis, email, and storage.
3

Deploy Application

Follow the deployment guide for your chosen method. Both guides include database setup, static file collection, and SSL configuration.
4

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

Configure AWS S3 for production static and media files:
STORAGE_BACKEND=aws
DJANGO_AWS_ACCESS_KEY_ID=your-access-key
DJANGO_AWS_SECRET_ACCESS_KEY=your-secret-key
DJANGO_AWS_STORAGE_BUCKET_NAME=your-bucket
DJANGO_AWS_S3_REGION_NAME=us-east-1
DJANGO_AWS_S3_CUSTOM_DOMAIN=cdn.yourdomain.com  # Optional CDN
Static files are uploaded during deployment with collectstatic.
Configure Cloudflare R2 for cost-effective S3-compatible storage:
STORAGE_BACKEND=r2
CLOUDFLARE_ACCESS_KEY_ID=your-access-key
CLOUDFLARE_SECRET_ACCESS_KEY=your-secret-key
CLOUDFLARE_BUCKET_NAME=your-bucket
CLOUDFLARE_R2_ENDPOINT_URL=https://account-id.r2.cloudflarestorage.com
CLOUDFLARE_R2_CUSTOM_DOMAIN=cdn.yourdomain.com  # Optional
R2 offers free egress bandwidth with S3-compatible API.

Security Considerations

Critical Security SettingsNever deploy to production without configuring these settings:
  • DEBUG=False - Prevents sensitive information exposure
  • Strong SECRET_KEY - Generate with Django’s get_random_secret_key()
  • ALLOWED_HOSTS - Restrict to your domain(s)
  • SECURE_SSL_REDIRECT=True - Force HTTPS
  • SSL/TLS certificates - Use Let’s Encrypt (free)

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
See the production checklist for the complete security configuration.

Monitoring and Health Checks

FootyCollect includes built-in health check endpoints:
EndpointPurpose
/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:
python manage.py check --deploy
This validates:
  • DEBUG is disabled
  • SECRET_KEY is secure
  • ALLOWED_HOSTS is configured
  • Database connectivity
  • Redis connectivity
  • SSL/HTTPS settings
  • Storage credentials (S3/R2)
See config/checks.py:1 for all production validation checks.

Database Backups

Both deployment methods include automatic database backups: Docker: Uses the awscli container for automated backups to S3 Bare Metal: Automated backups during deployment via deploy.sh

Manual Backup

# Backup database
sudo -u postgres pg_dump footycollect_db > backup_$(date +%Y%m%d).sql

# Restore database
sudo -u postgres psql footycollect_db < backup_20260302.sql

Next Steps

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