You’d need to change stuff in the let’s encrypt config, which is (at least part of) why you need to rebuild.
Why not upgrade? That’s what you really need to do. Just how old is it?
But you could contrive to pin discourse_docker
(aka /var/discourse
and the Discourse version that you’re on. You might also need to pin all of the plugins.
If you’ve got something else doing the https resolution then you might be able to avoid the rebuild and just do the other stuff in Change the domain name or rename your Discourse.