10-year self-hosted discourse admin asks: why not launcher cleanup as part of rebuild?

Hey all. My name is Lee, and I’ve been self-hosting Discourse on and off since 2013. I remember having to screw around with rbenv to even get started. I remember having to compile nginx with Phusion Passenger to make things run. I remember arguing with @sam probably ten damn years ago that switching to Docker was capitulating to developer it-works-with-my-home-directory-and-my-nightmare-of-dotfiles weakness (and being dead-ass wrong!). I remember the first time I heard the phrase “bike-shedding”. To quote the man, I remember everything.

After being away for several years, I’ve had occasion to come back to self-hosting Discourse as a replacement for native Wordpress comments on a Houston-area weather site that typically does ~10k PV/day, but during hurricanes, might do ~2 million PV/day to ~1 million unique visitors. We’ve struggled with wordpress’ native comments for years, but as of last Wednesday, we’re live on self-hosted Discourse. (And on Graviton3, no less! Seriously, it just works and it’s great.)

Here’s the point I’m getting round to: it’s 2025, and as a self-hoster I’m still dealing with manually managing my docker image space. I present a story about /dev/root, told in code snippets, after less than a week in production:

[11:49:56] 0 ✓ (1.8ms)
root@discourse:/var/discourse # df -h
Filesystem       Size  Used Avail Use% Mounted on
/dev/root         30G   21G  9.6G  69% /
tmpfs            7.7G     0  7.7G   0% /dev/shm
tmpfs            3.1G  1.1M  3.1G   1% /run
tmpfs            5.0M     0  5.0M   0% /run/lock
efivarfs         128K  3.6K  125K   3% /sys/firmware/efi/efivars
/dev/nvme1n1p16  891M  109M  720M  14% /boot
/dev/nvme1n1p15   98M  6.4M   92M   7% /boot/efi
/dev/nvme0n1      32G  346M   30G   2% /var/discourse
tmpfs            1.6G   12K  1.6G   1% /run/user/1001
overlay           30G   21G  9.6G  69% /var/lib/docker/overlay2/5a649418bbfc064f488e895572eec1ace487a3eaa324fe1d8e3b395e6c5e3645/merged

[11:49:59] 0 ✓ (4.8ms)
root@discourse:/var/discourse # ./launcher cleanup
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y 
Total reclaimed space: 0B
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: discourse/base@sha256:3696bdf18652b5455bd33795ec3b8e0f201c17a04f0e0126fc0317ed821373cd
....

[a whoooooooooooooooole lot of lines redacted]

....
Total reclaimed space: 12.43GB

[11:50:34] 0 ✓ (27.8s)
root@discourse:/var/discourse # df -h
Filesystem       Size  Used Avail Use% Mounted on
/dev/root         30G  6.9G   24G  23% /
tmpfs            7.7G     0  7.7G   0% /dev/shm
tmpfs            3.1G  1.1M  3.1G   1% /run
tmpfs            5.0M     0  5.0M   0% /run/lock
efivarfs         128K  3.6K  125K   3% /sys/firmware/efi/efivars
/dev/nvme1n1p16  891M  109M  720M  14% /boot
/dev/nvme1n1p15   98M  6.4M   92M   7% /boot/efi
/dev/nvme0n1      32G  346M   30G   2% /var/discourse
tmpfs            1.6G   12K  1.6G   1% /run/user/1001
overlay           30G  6.9G   24G  23% /var/lib/docker/overlay2/5a649418bbfc064f488e895572eec1ace487a3eaa324fe1d8e3b395e6c5e3645/merged

[11:55:28] 0 ✓ (3.3ms)
root@discourse:/var/discourse #

I love you guys. I love discourse. I am wedded to the product and I intend to keep using it more or less forever.

But, like…just, why. Why is it 2025 and I am personally by my own-ass self still screwing around with launcher cleanup? Why is image management not an inherent function of launcher?

Again, I love you guys. I chose Discourse for SCW because I believe in what you guys have built and I love using it. But like… that’s half my poor AMI’s boot volume tied up with useless crap that could—at least if I understand the technical side of things—be automatically managed.

Not meaning to complain—just checking in again after a few years away from the admin’s chair. I love the AI spam detection and the AI triage, especially in a weather forum where politically charged posts re: climate change (either for or against) are a regular feature. Thanks for everything <3

4 Likes

Great to see you back, Lee! :sunflower:

I had the same thing happen on my self hosted site just this week. Backups were failing and I let that go for a week or so because I was away and didn’t have access to my laptop. As soon as I got back I ran cleanup and recovered lots of disk space and the backups were able to run again.

1 Like