Build catapults and get a ton of rocks, then pick a cliff or build a wall somewhere, put a 1-z drop at the base of it with a way to access it, and stockpile rocks near the catapult. Set some dorfs to huck all the rocks at the wall to raise their skill up effectively without wasting ballista ammo.
Now build a long hall or some other way to channel foes, ideally in a way that they start marching in single file even, stick the ballista at one end behind fortifications, place an ammo dump there, a bed/food/drink dump and a way to lock it is handy, then when you get attacked let stuff file into the killzone, get an operator or several into the ballista room or rooms, lock them in so they don't panic and run from the enemies, and order them to huck death at your foes.
As for the weapons.
A legendary miner with decent armor is gonna be a far more terrifying foe than a trainee axe dorf or sword dorf for a looooong time, and remains more than capable of filling the same role as an axe lord or swordmaster later on.
You don't have to dig out big ugly pits, with a couple of your starting miners just digging out the fort they should get pretty darn high on the lethality scale even if they don't hit legendary as fast as grinding out a soil layer will. Once they do get to be legendary miners there is little reason to not swap in other dorfs with potential and have the old miners swap to military training full time. Pretty sure they will all get benefits from the stat boosts due to the skilling up, and you'll never be in a situation where too many dorfs capable of swinging a pick with lethal accuracy is a bad thing... besides a full fort tantrum spiral I guess.
Once you're able to train and equp other melee dorfs you may have had to deal with a siege or two, night creatures, ambushers, a titan or minotaur level semi-megabeast, and possibly even a forgotten beast or more.
As I had a fort saved by an engraver/miner who took down a fb with dorf-rotting blood and gases, I've got much love for miner militias, and generally set up civilian squads anyways to get around clothing issues. Having everyone wearing leather armor/trousers/boots means they won't get pissy about their favorite pair of ratty socks falling apart, and it gives a little bit of extra survivability for random dorfs in unlucky situations. When I get a chance I start passing out crossbows, hammers, picks, and or spears depending on the main threats in the area, and have all civvies do some light training on a relaxed schedule until the population builds up and I can cherry pick the most capable dorfs for a full on murdersquad.
Now, when you face things like a full on 80+ goblin/troll siege with mounts and elite units, you're gonna want well rounded and fully geared military dorfs dodging and parrying and not being encumbered by their armor for sure.
Starting out though the best way to avoid losing dorfs to a 4~8 gob ambusher group without turtling the fort up is going to involve turning the attackers into a pile of goblin giblets... goblets? Hmmm... but yeah mining is just a ridiculously fast combat skill to train, so it's a question of frontloading offensive ability first or hoping you're able to deal with your first encounters with a squad of trainees.