I make traps with empty water or soda bottles and bait it with apple cider vinegar and a couple drops of liquid dish soap. I have 10 of these in my spare bedroom I call my “winery” and keep them baited whether wine is Fermenting or not. They work very well. I keep them in 6 pack bottle holders so they don’t tip over btw.
Most vinegar is pasteurized but if not sure the acetobater kill temp is about 130 F so if one is concerned about cross contamination it would be easy to pasteurize it yourself.
I’m not sure that is necessary though since my understanding is that acetobater is practically ubiquitous in nature and probably on grapes on the vine anyway.
I’m no expert on the subject but have read that practically all fruit flys have it in their gut biome. In my non expert opinion it seems the risk of contamination from vinegar is far more acceptable than the risk of a fruit fly infestation because sooner or later one must uncover the must.