The thread title is misleading, we're talking about turrets, not docking in general.
A) Add a rotator block, so guns can rotate, but are still part of the same entity as the turret base.
B) Make the gun AI communicate with the turret AI with the turret AI as boss who decides which target to...