Prerequisites
Only Docker is required:- Docker 24.0.0 or later
- docker-compose (usually bundled with Docker Desktop)
On Apple Silicon (M1/M2/M3) Macs, you’ll need to enable x86/amd64 emulation in Docker settings.
Quick Start
Start the containers
Launch all services using docker-compose:This builds and starts:
- web - Ralph application (port 8000)
- db - MySQL 5.7 database
- redis - Redis cache server
- inkpy - Background job processor
- nginx - Static file server (port 80)
Access Ralph
Once all services are running, access Ralph at:- Username:
ralph - Password:
ralph
Docker Architecture
Service Overview
Thedocker/docker-compose-local-dev.yml defines these services:
docker/docker-compose-local-dev.yml
Volume Mounts
The web container mounts your local source directory:- Code changes are immediately reflected in the container
- You can edit files on your host machine
- No container rebuild needed for code changes
Database Persistence
Database data is stored in a Docker volume:Development Workflow
Rebuilding Static Assets
When you modify JavaScript, CSS, or install new npm packages:- Runs
npm installto update dependencies - Executes
gulpto rebuild static files
Viewing Logs
Monitor all services:Running Django Management Commands
Execute Django commands inside the web container:Running Tests
Execute the test suite:Accessing the Container Shell
Open a bash session in the web container:PyCharm IDE Integration
Ralph supports remote Python interpreter configuration in PyCharm Professional.Add Docker interpreter
- Go to Settings → Project: ralph → Python Interpreter
- Click Add Interpreter → On Docker
- Select
docker/Dockerfile-local-interpreteras the Dockerfile - Change context folder to
.(project root)
Configure platform (Apple Silicon only)
If using Apple Silicon architecture:Under Options → Build options, add:
This requires amd64 emulation enabled in Docker Desktop.
Container Build Details
The development Dockerfile (docker/Dockerfile-local-dev) is based on Ubuntu Jammy and includes:
System Packages
Entry Point Script
The container runs/opt/local/docker-local-dev-entrypoint.sh:
docker/provision/docker-local-dev-entrypoint.sh
- Installs Python dependencies
- Builds static files if missing
- Starts the development server
Environment Variables
Customize container behavior with environment variables:| Variable | Default | Description |
|---|---|---|
DATABASE_NAME | ralph_ng | Database name |
DATABASE_USER | ralph_ng | Database username |
DATABASE_PASSWORD | ralph_ng | Database password |
DATABASE_HOST | db | Database host (service name) |
REDIS_HOST | redis | Redis host (service name) |
REDIS_PORT | 6379 | Redis port |
REDIS_DB | 0 | Redis database number |
Useful Commands
Container Management
Database Operations
Troubleshooting
Port Already in Use
If port 80 or 8000 is already bound:Container Won’t Start
Check logs for errors:- Platform mismatch (use
--platform linux/amd64on ARM) - Out of disk space
- Port conflicts
Static Files Not Building
On Apple Silicon, Node.js builds may hang. Try:-
Build static files on host:
- Or disable Rosetta emulation in Docker settings
Database Connection Failed
Ensure the database container is healthy:Comparison with Local Setup
| Aspect | Docker | Local |
|---|---|---|
| Setup Time | Fast | Moderate |
| System Dependencies | Minimal | Many |
| IDE Integration | Limited | Full |
| Performance | Good (slower on Mac) | Excellent |
| Debugging | More complex | Direct |
| Consistency | Identical across systems | Varies |
Next Steps
Local Setup
Switch to local development setup
Architecture
Learn about Ralph’s architecture