Chop one onion and fresh thyme into chunks and keep them aside.
Cut the bacon slices into one-inch pieces and keep them aside.
Preheat the oven to 425 degrees F (220 degrees C).
Set pie dough on a 9-inch pie plate and chill the pie for at least 20 minutes before baking.
Place the aluminum foil on the chilled pie crust and fill it halfway up with baking weights to set the foil.
Bake it in the oven for 7 minutes. Remove the foil and baking weights and bake it for another 5 minutes or until golden brown—lower the temperature to 325 degrees F.
Cook thickly sliced bacon in a saucepan until golden brown.
Remove it with the tongs and drain the fat on the paper towels.
Add chopped leeks and onion with a pinch of salt, black pepper and cayenne pepper until tender and translucent for about 5 to 7 minutes
Whisk eggs, heavy cream, and milk in a bowl. Add chopped thyme and stir to combine.
Put your prepared onion-leek mixture on the bottom of your crust. Top with cooked bacon followed by shredded Gruyere cheese. Spoon in egg mixture carefully.
Sprinkle the remaining onion-leek mixture, bacon, and Gruyere cheese.
Bake the filled Quiche in the oven until it is browned and set and is no longer jiggly in the center for 40 to 45 minutes.