|Really cheap fruit fly trap protecting my precious garden tomatoes|
It's hard to keep them out. They seek out fruit, vinegar, anything that smells fruity and over-ripe. They come in on your produce. They sneak in when you aren't watching. I've found it's possible to trap them and here's an inexpensive bait that you can set out. Put the bait in a small container, like a cheap clear plastic take-out container. Set it wherever you see fruit flies: by your bowl of fruit, by your kitchen compost, by your sink (garbage disposals are a big attractor).
You can buy traps with bait but I think this works just as well and it is a whole lot cheaper. Apple cider smells like apples which makes it a great bait. Other fruity vinegars probably work as well but I haven't experimented with them. Cider vinegar is the cheapest of fruity vinegars so I stick with that. The dish soap prevents the flies from escaping once they land on the liquid but you don't need much. Couple of drops is enough. Stick to soap with a mild scent and doesn't say it's odor-eliminating; you want it to smell like vinegar. I experimented with eucalyptus scented soap and they didn't like that at all. Lemon-scented soap may have the same problem, repelling rather than attracting flies.
This recipe makes enough for a few traps. You'll need to replenish the bait now and then. I haven't quite figured out the frequency of that. It depends on how warm it is and how fast the vinegar mixture evaporates.
Fruit Fly Bait
¼ cup apple cider vinegar
½ cup warm water
2 teaspoons sugar
1-2 drops of cheap liquid dish soap
Combine the vinegar, water and sugar to dissolve sugar. Add dish soap. Put about ¼ cup of bait in a clear container and place near your fly infestation. Replenish bait when you see flies around again and they aren't heading for the traps, every 1-2 weeks. You can also add a little more water if it evaporates off.