I didn't said that you're not gonna to use ship core. You're just not gonna need to spawn it manually then dock it. For a good and short turret tutorial, there is
this. Also don't worry if your turret isn't protected because if she's docked to your homebase, she's gonna be invincible too.
What i was referring about is this.
Then by using this you'll have to place the rail docker and the core of the entity and they're gonna be already docked to your planet.
It doesn't change anything from spawning your turret then dock it but it's easier to spawn them right this way and avoid being destroyed while building turrets. :p