This is sort of a makeshift solution, but it worked for us so we've kept at it for more than a decade. We've always just used a glass, half-gallon
milk bottle with a plastic snap-on cap. When setting out to ferment, we'll put a couple paper towels folded over the cap and a heavy ceramic mug over top of the lid. A sort of makeshift gasket. When the gasses build up and pop the top, it just sits on there loosely under the paper towel gasket and mug. This insures it remains covered from stray fruit flies of whatever.