Discourse supports one-click static-dynamic separation. You can find the #DISCOURSE_CDN_URL: definition in the containers/app.yml file in your installation directory (/var/discourse), remove the leading #, fill in your CDN URL after it, then run ./launcher rebuild app to rebuild Discourse.
As for the CDN URL, you can easily obtain one using the mirror back-to-source feature of object storage or the custom Host function of a CDN.
Finally, here is the official documentation link for this configuration option: