Take out the pirate base that's raiding your colony. Go to any of your colonies, head to the bar and there'll be an option to buy someone "something more palatable". That will tell you where the pirate base that's raiding your colony is located, assuming you don't know already. Either way you can go there and smash it.
I should add that the way pirate bases work is that there's up to three pirate bases scattered around the map at any one time which will random attack any inhabited system, including yours, and these existing, established bases are not shy of rampaging through your newly founded colonies if they feel like it. In addition your colonies will consistently generate new pirate bases which will only ever attack your colonies, but they'll always start out as tier 1 bases (in the current patch), so even with basic defences it can take weeks if not months for them to become an actual problem.
What you're dealing with sounds like an existing tier 3 base randomly rolled your system and started rampaging around long before you had the chance to build up and prepare, for the record. The first raid from the scripted first base is...I don't remember exactly, I think it's like 1-3 fleets of 3-5 ships each? Point is that against a fleet that can take care of tier 3 pirate bases, which I consider the necessary minimum before founding colonies, it's nothing.