Worm Farms
Although fruit flies may only be one-third the size of a normal fly, they can pose a big problem to worm farms. Fruit flies gather wherever there is fruit. Since fruit scraps are a common food for your worms, it seems that the bins are often swarming with them. There are ways to prevent this.
The easiest way is to make sure all food is buried at least two to three inches deep and covered with multiple layers of damp newspapers. Another way to prevent them is to freeze or microwave the scraps before putting them into the bin. Of course, remember to return them to room temperature first.
If the flies are already there, traps may be the easiest. You can try some beneficial nematodes which prey on insects like the fruit fly. The easiest way to get rid of the fruit fly is to prevent the fruit fly.