Alternatively, massive death-star class ships can be built around orbital habitats by planet industry. The draw back to this approach is that if weaponized they would burn maintenance supplies like fuel if you play with maintenance failures on.
Those are the only two Asteroid-fortress production methods I know of.
Naturally, a modular approach would circumvent the maintenance problem.
Build a huge Death Star containing an Orbital Habitat (to enable Factory production) which includes all of the commercial components... Engines, Armor, CIWS, Maintenance modules, etc.
Then build several dozen Tractor-Beam equipped Weapons and Sensor modules, each with its own Engineering section. Because the Weapons and Sensor modules are relatively small, there will be little problem with maintenance life-times... and you could include a few Maintenance-storage modules anyway.
The weapons modules can lock onto the Death Star mothership with their Tractor Beams and be carried into battle, while the Mothership's Maintenance modules can zero-out the maintenance clocks of the weapons modules any time the assembly reaches an asteroid, moon, or non-gas-giant planet. With 5,000-ton weapons and sensor modules, only 25 Maintenance modules (total) are needed to overhaul as many parasites as you care to attach to the mothership.
EDIT:
Like so:
Death Star class Orbital Habitat 816,800 tons 10424 Crew 67368.2 BP TCS 16336 TH 34179.6 EM 0
5977 km/s Armour 20-778 Shields 0-0 Sensors 1/1/0/0 Damage Control Rating 1 PPV 0
MSP 52 Max Repair 200 MSP
Troop Capacity: 26 Battalions Cargo 5000 Habitation Capacity 50,000 Cargo Handling Multiplier 5 Tractor Beam
Maintenance Modules: 25 module(s) capable of supporting ships of 5000 tons
Magnetic Confinement Fusion Drive E0.6 (250) Power 390.625 Fuel Use 6% Signature 136.7188 Armour 0 Exp 4%
Fuel Capacity 5,150,000 Litres Range 189.1 billion km (366 days at full power)
CIWS-250 (20x8) Range 1000 km TS: 25000 km/s ROF 5 Base 50% To Hit
This design is classed as a Commercial Vessel for maintenance purposes
This design is classed as an Orbital Habitat for construction purposes
Moves at nearly 6,000 kps (over 5,000 kps with the weapons and sensor modules attached), enough fuel for a year at full speed, a cruising range of nearly 200 billion km, twenty layers of Armor and twenty CIWS, and it carries a Division of ground troops and enough Maintenance modules to keep any number of attached 5,000-ton weapon and sensor modules overhauled... although the overhauls themselves will require it to orbit a planet, moon or asteroid, and will require a small quantity of minerals, carried internally or in tractor-locked modules.