I used to loose cities to early zergers too, i tried building more units and less wonders, but then i couldn't pay the upkeep :-(
So, i learned to place my cities in more defensible locations, which made it possible to hold them off with a smaller force. Of course a smaller army won't deter them from attacking in the first place, but these defensive wars are a lot of fun. Especially once you end up with a couple of range-promoted range units with cover and march , and decide to take the fight to him. The tricky bit is working out how many of his cities to take without becoming a warmonger yourself. OTOH if you are too lenient he'll be back for more soon. Ideally weaken him enough so his other enemies destroy him for you.
Defensible cities 101 -
Can an archer garrisoned in the city hit all tiles around the city to two hexes?
Forest/Jungle block line of sight to the tiles behind, unless the city is on higher ground than the tress. If in doubt, chop them!
Hills block line of sight to tiles behind unless the city itself is on a hill
Rivers put a 33% penalty on attacks across one. Together with food yields from farms with access to fresh water, water mills, gardens and hydro plants, river cities are great.
Mountains are impassible and so reduce the number of axes the enemy can attack from.
Finally, distance. I am reluctant to settle more than 6 tiles away because connecting the city with a road becomes expensive and without that, it takes too long to bring reinforcements if attacked. Also, if you're settling that far from your own cap, the chances are you're forward settling another civ, even if you haven't met them yet. And that makes them mad!
If you have a defensible location, you can beat any attack with two units. Do the opposite, and put a city on flat plains surrounded by hills because this spot brings the highest number of luxes/specials within 3 hexes, and you'll need a serious military presence to hold it. Garrisons within the city wont be able to hit enemy units because their line of sight is blocked, which means you need ranged units on the surrounding hills, which are outside the city and going to take subtantial damage - so you need melee units to protect them, and spares.