Docker Cheat Sheet
Quick reference for all Docker commands you'll need when working with Grit projects. Keep this page bookmarked — it covers starting services, viewing logs, database operations, Redis, MinIO, cleanup, and more.
Default Services & Ports
Every Grit project ships with these four infrastructure services via Docker Compose:
| Service | Port | Dashboard |
|---|---|---|
| PostgreSQL | 5432 | — |
| Redis | 6379 | — |
| MinIO | 9000 (API), 9001 (Console) | http://localhost:9001 |
| Mailhog | 1025 (SMTP), 8025 (UI) | http://localhost:8025 |
Starting & Stopping Services
Start all services in the background
Stop all containers even for other projects
Stop all services and remove containers
Restart all services
Start a specific service only
Stop a specific service without removing it
Checking Service Status
List all running containers
List all containers including stopped ones
List services for the current project
Live resource usage (CPU, memory, network I/O)
Viewing Logs
Show all service logs
Follow logs live (stream in real time)
Show logs for a specific service
Show only the last 50 lines for a service
Database Operations
Common commands for working with the PostgreSQL container directly. Replace grit_dev with your actual database name if you changed it.
Open an interactive psql shell
Backup the entire database to a SQL file
Restore database from a SQL backup file
List all tables in the database
Redis Operations
Commands for inspecting and managing the Redis cache, sessions, and job queue data.
Open an interactive Redis CLI session
List all keys stored in Redis
Clear all Redis data (cache, sessions, queues)
Show Redis memory usage statistics
Warning: FLUSHALL deletes everything in Redis including active sessions and pending job queue entries. Use with caution in shared environments.
MinIO (File Storage)
MinIO provides S3-compatible file storage for development. Access the web console to manage buckets and files visually.
MinIO Console
http://localhost:9001Web-based file browser. Create buckets, upload files, and manage access policies. Default credentials: minioadmin / minioadmin
Set up the MinIO client alias for CLI operations
Cleanup & Reset
Commands for cleaning up containers, images, and volumes. Use these when you need a fresh start or want to reclaim disk space.
Stop all services and delete volumes (RESETS ALL DATA)
Remove all unused containers, networks, and dangling images
List all Docker volumes
Remove a specific volume by name
Danger: docker compose down -v permanently deletes all volume data including your database, Redis cache, and uploaded files. Make sure to back up any important data first.
Port Conflicts
If a service fails to start because a port is already in use, these commands help diagnose and resolve the issue.
Show which containers are using which ports
Stop all running containers (nuclear option)
For more detailed troubleshooting steps including OS-specific port debugging, see the Troubleshooting page.
Production Docker
Grit ships with a separate production compose file that builds and runs the full application stack. These commands use docker-compose.prod.yml instead of the default development file.
Start all production services in the background
Follow production API logs
For full production deployment guides including cloud providers and CI/CD, see the Deployment page.