There are no camp sites near the dockyard. But you could park at Port Solent Marina and get a bus from there.
I believe people stay the night , plenty of parking free, but if you do go there stay at the far end, although the bus stop is near to the gates (By the cinema) but will be busy that end Cinema/Shops and restaurants all at that end You do mean the dockyard? or do you mean the Marines museum (southsea) or the submarine museum (Gosport)