Rebuild Your Docker Compose Stack
Published: Oct 6, 2020
Updated: Feb 16, 2024
Updated: Feb 16, 2024
When using volumes with Docker Compose, especially with Node.js projects, sometimes vague errors show up, like file permission errors for reading or writing a file. When this happens, it can be helpful to rebuild your Docker Compose stack from scratch to resolve these errors.
-
Down everything, which stops and removes containers, and removes volumes
docker-compose down -v
-
List all volumes to confirm they’re removed
docker volume ls
-
If volumes still exist, remove them one-by-one
docker volume rm <VOLUME_NAME>
-
Build and up everything in detached mode
docker-compose up -d --build