I suspect that there is a backup in /var/discourse/shared/standalone/backups/default
that you could retrieve. You can also run a backup from the command line. Perhaps you have backups there that are eating up your disk space?
I’d make sure that you do have a backup and then do the rebuild.
Yes, it’s generally safe to recover space that way unless you have some reason to believe that it’s not (and you’d know if you had other docker containers on the machine that you had for some other reason). If Discourse is running, then the current container won’t be deleted by the cleanup, so you will still be able to restart that container.