One way to do this is to have multiple containers, one for stable, one for main.
Another option is Using dv (Discourse Vibe) to configure Discourse AI in development
You don’t have to use any of the AI features of dv, if you don’t want to (though they can be handy, of course). But at core, dv lets you spin up multiple containers very quickly. So you could run two containers side-by-side (or more), one for each version/branch.