It seems that I should have some minimum amount of military in order to prevent these "You're weak and I should get the opportunity to crash you" wars.
So, how big military should I have in order to avoid these wars?
And how do I evolve if I spend my production/gold in military?
There will be different solutions depending on the map type and AI attitudes/personalities.
But as I see it through my emperor/immortal games, your biggest weapon before turn 75 @standart speed is diplomacy. Second one is settling away from AIs and preventing them from settling near you.
By diplomacy I mean focusing on intelligence aka scouts early game. 2+ scouts mean business for sure. They find AIs for you, they provide info for the best settling places and they get you some extra cash from meeting CSs. Ruins too, but I hate my bad luck so I dont count on ruins

Then once your scout gets AI, theres very little time to get early PoC/PoS. Usually farthest AI asks for a PoC really soon after you meet him. 1-2 more PoCs can help with the trades and distraction during next steps.
The great power of early scouting is that:
who meets AI first gets PoC first.
And if you come too late, they got PoC with another AI and you wont get any PoS between them for sure. Thats why scouts are so powerful!
I ask for as many PoS as I can immediately after I get PoC with the civ. Usually it gets me 1 or 2 PoSs depending on personality/map settings.
Crucial part here is to get a PoS from your nearest neighbours and PoS on them cause they are most dangerous ones in the game. Later, when youll get ICS running, AI wont be a trouble, but early they can be troublesome.
Close neighbours mean trouble only cause AIs currently strictly territorial creatures. If you get closer to their lair, they start to insult, then DoW very soon. And if theres enough distance between you and them itll be another peaceful 10 turns. Before AI will settle near you and blame you for being too close
Then comes distraction. If you got PoS on your dangerous neighbour, there is high chance your partner can be bribed into war. So the question will be: is it worth bribing to get another 10-20 peaceful turns or not worth doing?
Good news are once you settle first 7-10 cities, income gets high enough to rushbuy some troops and resist unwelcomed guests. Im feeling kinda safe when i get to 10 cities while teching to longswordsmen.
So wish you good luck on getting a safe game
