I don’t use joomla, so that said there may be a better answer that comes along.
In general, the way I would approach this is to build it in a Fully hosted sub-domain. The key is to always create relative rather than absolute links.
A relative link generally looks something line “./images/test.jpg”
An absolute link generally looks like “http://mydomain.com/images/test.jpg”
A properly constructed relative link won’t care if you change the domain.