Overview
Docker Compose provides a complete FootyCollect development environment with all services pre-configured. This is the recommended setup for most developers.Services Included
The Docker Compose setup includes the following services:| Service | Description | Port | Image |
|---|---|---|---|
| django | Django application server | 8000 | footycollect_local_django |
| postgres | PostgreSQL 14+ database | 5432 | footycollect_production_postgres |
| redis | Redis 6 cache and message broker | 6379 | redis:6 |
| celeryworker | Celery background task worker | - | footycollect_local_celeryworker |
| celerybeat | Celery periodic task scheduler | - | footycollect_local_celerybeat |
| flower | Celery monitoring web UI | 5555 | footycollect_local_flower |
| mailpit | Email testing interface | 8025 | axllent/mailpit |
Prerequisites
Install Docker and Docker Compose:- macOS
- Linux
- Windows
Quick Start
Configure environment files
Create environment configuration files in PostgreSQL environment (
.envs/.local/:Django environment (.envs/.local/.django):.envs/.local/.postgres):Build and start services
Build the Docker images and start all services:To run in detached mode (background):
First build may take 5-10 minutes as it downloads base images and installs dependencies.
Access the Application
Once all services are running:FootyCollect
http://localhost:8000Main application interface
Django Admin
http://localhost:8000/adminAdministration panel (requires superuser)
Flower
http://localhost:5555Celery task monitoring
Mailpit
http://localhost:8025Email testing interface
Docker Compose Configuration
Thedocker-compose.local.yml file defines the complete development stack:
Common Commands
Managing Services
Django Management Commands
Database Operations
Redis Operations
Shell Access
Development Workflow
Code Changes
The Django service mounts your local code directory, so changes are reflected immediately:- Edit code in your local editor
- Django auto-reloads (with Werkzeug watchdog)
- Refresh browser to see changes
For changes to requirements or Dockerfile, you’ll need to rebuild:
Running Tests
Code Quality
Volume Management
Docker volumes persist data between container restarts:Troubleshooting
Port Already in Use
If port 8000 is already in use:Database Connection Issues
Redis Connection Issues
Permission Issues (Linux)
If you encounter permission issues with volumes:Clean Rebuild
For a completely fresh start:Performance Optimization
macOS/Windows Performance
For better I/O performance on macOS and Windows:- Use Docker Desktop’s native volumes (already configured)
- Delegate file watching to the container (already configured with watchdog)
- Exclude node_modules and cache directories from volume mounts
Resource Limits
If Docker is slow, increase resources in Docker Desktop:- Memory: 4GB minimum, 8GB recommended
- CPUs: 2 minimum, 4 recommended
- Swap: 1GB minimum