Skip to main content

Disk Management

Why Atlas Fills Up

Atlas (staging server) accumulates Docker images rapidly because:

  1. Every develop branch push builds a new Docker image
  2. Old images are not automatically removed by Docker
  3. Each image is 500MB–1.5GB (multi-stage build outputs for API + web)
  4. The staging server has a smaller disk (40GB SSD vs Hermes's 80GB NVMe)

A full disk causes deploy failures (no space to write the new image) and can crash running containers.


Daily Automatic Prune (Atlas)

A cron job runs on Atlas at 00:01 Athens time:

0 1 * * * docker system prune -f --filter "until=24h"

This removes:

  • Stopped containers
  • Unused networks
  • Dangling images (untagged)
  • Build cache older than 24 hours

-f — no confirmation prompt (required for cron). --filter "until=24h" — only prunes resources older than 24 hours (keeps the most recent build cache warm for faster next builds).


Manual Disk Check

# Overall disk usage
df -h

# Docker-specific usage
docker system df

# Docker breakdown (verbose)
docker system df -v

Typical output on Atlas after a week:

TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 12 2 8.5GB 7.1GB (83%)
Containers 2 2 0B 0B
Local Volumes 3 2 1.2GB 0B
Build Cache 45 0 3.2GB 3.2GB

Manual Prune (Emergency — Free Space Now)

When the disk is critically full:

# Remove everything unused (aggressive)
sudo docker system prune -a

-a removes ALL unused images, not just dangling ones. This includes images that are tagged but not currently running. This will make the next deploy slower (no layer cache) but frees the most space.

# Or selectively
sudo docker image prune -a # remove all unused images
sudo docker builder prune -a # remove all build cache

After pruning, verify:

df -h

Hermes Disk Management

Hermes (production) is less susceptible because:

  1. Larger disk (80GB NVMe)
  2. Only master pushes trigger production builds (less frequent)

But still monitor. If Hermes fills up:

  1. The same manual prune steps apply
  2. Do not run docker system prune -a while a deploy is in progress — it may delete the image being pulled

Storage Box Usage

Hetzner Object Storage (Mneme bucket) usage is monitored in the Hetzner Cloud Console. The BX11 plan is 1TB — well within current usage. Check if booklet PDF storage grows unexpectedly.


Database Backup Storage (Iris)

Backups are stored at /var/backups/pcmr/ with 30-day retention. The cron that manages retention:

# Delete backups older than 30 days
find /var/backups/pcmr -name "*.dump" -mtime +30 -delete

Check Iris disk usage:

df -h /var/backups
du -sh /var/backups/pcmr/

Alerting

Uptime Kuma at status.pcmr.gr monitors service availability but not disk usage. If you want disk usage alerts, consider adding a monitoring check or a cron that sends an email when disk usage exceeds 80%.