What you are looking for are probably resupply ships...
You don't want to run a shipyard outside your area, it will not be well supplied and ships try to repair/retrofit will be stuck for ages. If you build a huge gas mine, you risk all the stocks (fuel) being reserved by freighters that never arrive.
That being said, what I would build if I were to build is a:
Star Base (because it looks cool to use that name...)
2-3 gas extractors
On a fuel source
Give the trading stuff to have it operational.
Defenses enough to handle its own pirates (shields, some long range weapon, a fighter bay or two).
Some extra cargo space
Extra docks to refuel fleets faster. At least enough to refuel half your fleet in one go.
No construction yards to prevent accidents
Deployed by a site that has pure supply of your choice of fuel (no other stuff). Gas clouds, typically.
Resupply ships are upgunned, mobile versions of the above, but they are not trading stations. Privates will never go there. You can also fill them up in friendly territory before moving to the area of fighting. They also won't mine anything but hydrogen/caslon, so you don't have to avoid other stuff to avoid the stores being filled with "junk".
I would not fight very far away, so ships needing repairs (2 armor damaged don't count) should head home. If you fight very far away, fuel up resupply ships, move in with force, and try grab a good colony (which hopefully got some resources stored). Build and defend a space port there (could be easier said than done if you grab something far away near the core enemy systems).