Container Management
Starting and Stopping
Clean Restart
To stop and delete the database (fresh start):Common Commands
Django Management Commands
Run anymanage.py command using:
Examples
Shell Access
Loading a Database Dump
If you have an existing database dump (e.g., from a previous development setup), you can load it into the Docker environment.Start with a clean database
Remove the existing volume and bring the containers back up:Wait a few seconds for PostgreSQL to initialize, then proceed.
Load the dump
If you see ownership or permission errors when loading a dump from a different environment, the
--no-owner --no-acl flags on pg_restore will ignore those. For plain SQL dumps, you can safely ignore ALTER OWNER errors — the data will still load correctly.Troubleshooting
Port Already in Use
If port 8000 (or 5432 or 11211) is in use, either stop the conflicting service or change the port mapping indocker-compose.yml:
docker-compose.yml
Database Connection Errors
The entrypoint script waits for PostgreSQL to be ready, but if you still see connection errors, try:Permission Issues with Mounted Volumes
On Linux, files created inside the container may be owned by root. Fix with:Stale Containers
If things seem broken after agit pull, try a clean rebuild:
Build Fails with “Invalid File Request”
If you see an error likeinvalid file request esp/public/media/images during docker compose build, run docker compose down first to remove the symlinks created by the entrypoint:
Docker Desktop Not Running (Windows/macOS)
Windows error:docker compose up --build.
Windows only: If the issue persists, open Docker Desktop → Settings → General and ensure “Use the WSL 2 based engine” is checked, then click Apply & Restart.
Docker Compose Configuration
Thedocker-compose.yml defines three services:
docker-compose.yml