Preheat the oven to 450 degrees F.
Cut the tomatoes in half.
Chop the leeks and onions.
Heat a large skillet over medium-high heat.
Add the coconut oil, onions, leeks, salt, and pepper and cook for 20 to 25 minutes.
Stirring occasionally, until the onions are soft and deep golden brown and set aside.
Roll out the piecrust and fit to your tart pan.
Bake in the oven for 5 minutes.
Sprinkle the cheeses in a single layer over the crust.
Top with the caramelized onions.
Lay the tomatoes over the onion mixture.
Sprinkle the parsley over the tart.
Mix together the egg and milk in a small bowl and brush it all over the crust around the edge of the tart.
Bake the tart for 15 to 18 minutes.
Remove the tart from the oven and allow it to sit for 5 minutes.