Chapter 7: Docker Volumes, Networks and Compose
7.8 Troubleshooting table
| Symptom | Likely cause | What to try |
|---|---|---|
API cannot resolve db |
Wrong network / typo in service name | Same Compose file networks; check service key spelling |
| DB empty after restart | Used down -v or anonymous volume |
Named volume; avoid -v on down |
| Port already allocated | Host 8080 busy | Change host side "8081:8080" or stop other process |
| Auth failed to Postgres | Password mismatch / old volume with old password | Align .env; or wipe volume on purpose and recreate |
compose: command not found |
Plugin missing | Install Compose plugin or use documented docker-compose binary for your OS |
| Build context huge | Missing .dockerignore |
Same habit as Chapter 6 |
Practice task
Pick two troubleshooting rows. Write the first command you would run for each on your laptop.