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
1
Clone the repository
2
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)
3
Initialize the database (first run only)
On first launch or after removing the database volume, initialize Ralph:This script performs:
- Database migrations (
ralph migrate --noinput) - Menu synchronization (
ralph sitetree_resync_apps) - Superuser creation (username:
ralph, password:ralph)
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.1
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)
2
Configure platform (Apple Silicon only)
If using Apple Silicon architecture:Under Options → Build options, add:
This requires amd64 emulation enabled in Docker Desktop.
3
Verify interpreter
After clicking Next:
- Verify the interpreter path is correct
- Confirm all Ralph dependencies are detected
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: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
Next Steps
Local Setup
Switch to local development setup
Architecture
Learn about Ralph’s architecture