How do I be civil to an ex friend that I lost over a jealous girlfriend?

We were good friends, our friendship wasn't perfect, we had a lot of arguments because he kept telling me I was ugly, which was demoralising. I managed to try to forgive that, as I am the sort of person that will go to great lengths to preserve any close friendship with anyone and I am a firm believer in trying to resolve issues until they're no longer resolvable. Then once I know there's nothing that I could've done to fix things, I move on. I tried talking through stuff, explaining that it's actually unhealthy, controlling behaviour for a partner to expect you to choose between them and a best friend, but it fell on deaf ears. He heard me without listening and I sensed that our friendship would end up with him ghosting me, so I ended it first. I can't stop him from coming to my social group activities. I want to handle it with dignity, but when I first see him, I might find it hard not to feel resentment and bitterness towards him for being stupid enough to not set boundaries with his girlfriend and stop her from trying to turn our friendship into a competition. On the one hand, I'm done with our friendship. On the other hand, I need to be civil and I want to seem like I don't care anymore by the time I see him and I know I can't make him go away. I sense that he's going to keep coming back to the social group to try to get my friendship back, on his terms, but while I will eventually forgive, I can't reconcile with someone who put me in a situation where neither he nor his jealous girlfriend trusts me to have him alone at my house for a harmless nonsexual non-romantic lunch or dinner.

Updates
5 d
I have tried repeatedly to fix our friendship, and I decided that it cannot be fixed and I can't and won't deal with more drama, like I had when my other friend had a jealous ex with mental health issues. I never put him in the situation where he had to choose. I'd say his girlfriend didn't either. It was his own decision to not stand up for me as his friend.
How do I be civil to an ex friend that I lost over a jealous girlfriend?
Post Opinion