For dough (use premade crust or use this recipe to make your own)
1cupall-purpose flour
1/2teaspoonsalt
6tablespoonsunsalted butterchilled, cut in ¼-inch cubes
3tablespoonsice water
For filling
2tablespoonsolive oil
2poundsyellow onionspeeled and thinly sliced
1teaspoonsalt
2tablespoonsport wine
1teaspoonfreshly ground black pepper
2ouncesfinely grated Gruyère cheese
1teaspoonfresh thymeplus extra for garnish
1eggslightly beaten
Instructions
If you are making your own dough
Stir flour and salt together with fork. Toss in butter. Using fingertips, work butter into flour until it resembles coarse meal, with some pieces of butter. Sprinkle in water while stirring with fork until dough comes together, adding another tablespoon of water if necessary. Form into ball and flatten. Wrap in plastic wrap and refrigerate 1 hour.
For filling
Heat olive oil over medium heat in deep skillet or pot. Add onions and salt. Cook onions, stirring occasionally, until they are golden brown and soft, about 30 minutes. Add port wine and cook, stirring, 2 minutes. Remove onions from heat and stir in pepper. Cool slightly.
While onions are cooling, roll out dough to fit in bottom and up side of 10-inch round tart tin. Sprinkle half of cheese over bottom of tart. Spoon onions into shell and spread evenly. Sprinkle 1 teaspoon thyme over onions. Brush exposed crust rim with egg wash. Sprinkle tart and crust with remaining cheese.
Bake in preheated 375 degrees F oven until crust is firm and golden and onions have turned a rich golden brown, without blackening, about 30 minutes. Remove and cool slightly. Serve slightly warm or at room temperature garnished with thyme sprigs.