This setup enables live code synchronization between your local directory and Docker container without platform-specific scripts.
- Docker installed on your system
- Docker Compose installed (usually comes with Docker Desktop)
docker-compose -f docker-compose.dev.yml up --builddocker-compose -f docker-compose.dev.yml updocker-compose -f docker-compose.dev.yml down- Your local project directory is mounted to
/codein the container - Changes made locally are immediately reflected in the container
- Changes made in the container are reflected locally
venv/- Virtual environment (container has its own)__pycache__/- Python cache files.git/- Git directory
- ✅ Edit code locally with your preferred IDE
- ✅ Changes automatically sync to container
- ✅ Django auto-reloads on file changes
- ✅ No rebuilds needed for code changes
- ✅ Works on Windows, Linux, and Mac
-
Start the environment:
docker-compose -f docker-compose.dev.yml up
-
Edit your code in your local IDE (VS Code, PyCharm, etc.)
-
See changes immediately - Django will automatically reload
-
Access your application at
http://localhost:8000 -
Stop when done:
docker-compose -f docker-compose.dev.yml down
docker-compose -f docker-compose.dev.yml up --builddocker-compose -f docker-compose.dev.yml exec web python manage.py migratedocker-compose -f docker-compose.dev.yml exec web python manage.py <command>- Use PowerShell or Command Prompt
- Docker Desktop must be running
- File paths work automatically with Docker Desktop
- Use terminal
- Ensure your user is in the docker group
- File permissions are preserved
- Use terminal
- Docker Desktop must be running
- File paths work automatically with Docker Desktop
You only need to rebuild when:
- Dependencies change (requirement.txt modified)
- Dockerfile changes
- New system packages needed
For code changes in Python files, HTML templates, CSS, etc., no rebuild is needed!