Precompiling assets takes 20 minutes

Interesting. Do you have the kernel settings as laid out in MKJ’s Opinionated Discourse Deployment Configuration?

(It’s always worthwhile to have swap, 2G or 4G or whatever free disk space will allow. I have minimal swap because I have minimal disk space.)