Because the base image does nothing by itself. You need to compile Discourse in it and then run it. And that is done by executing a ./launcher script outside of the image first. So you should first try to install it the official way and then think about the options.
The Discourse installation procedure is not very common but over the years I really like the approach for one reason, which you will only appreciate after being an admin for some time. And that is the possibility to upgrade it after each commit to the source code. It’s incredible. You report a Contribute > Bug, after 1 hour it may very well be addressed by the team or the community, the automatical tests are executed and the commit is merged and available. And you can upgrade straight away. Because you recompile your Discourse on the latest source code.
So there is no image where any specific version would be compiled. You get an “empty” image and compile your version from the point you want and with the combination of plugins you need. And it still works!
You don’t get this kind of flexibility anywhere else.
So I am not sure, but if you want to make a docker compose file, you will need to replicate the ./launcher script procedure inside the compose file, so you compile it to another image, which you can then just plug in. But you cannot use the built-in procedure when you need an upgrade. You will have to go and compose a new version by yourself.