PhilanthropyDataCommons / deploy

Deployment scripts for Philanthropy Data Commons service
GNU Affero General Public License v3.0
2 stars 2 forks source link

Automatic disk cleanup would be nice #116

Open bickelj opened 2 months ago

bickelj commented 2 months ago

In the test system over the weekend, the continuous integration script notified us of a couple failures. It turns out the disk was probably temporarily full. It is easy enough to run docker system prune --all when verifying that containers are up, but a more regular, targeted approach would be better because it is best to have the previous image present in case we need to roll back.

bickelj commented 3 weeks ago

A safer command that can leave at least one image assuming we built an image in the past 336 hours: docker system prune -a --filter "until=336h"

Perhaps even safer: [[ "$(docker ps | wc -l)" -eq "4" ]] && docker system prune -a --filter "until=336h"