I have a compost pile but it's not in my home, and I need to store the kitchen scraps temporarily somewhere. I use a small plastic bin for that purpose. I don't have any brown materials, only nitrogen-rich materials. When I open the bin, it has a sharp and strong odor - it's not like rotten eggs, it's different. I don't know what this gas is, but is it safe? I hope the bin doesn't explode! The bin is very small and it's sealed (of course), it's about 40x30cm (~1x1 feet).
Well, you'd have to come up with the spark and the oxygen to get an "explosion", but you certainly can generate methane that way - however, if you don't leave it for long periods that seems HIGHLY unlikely.
Take the compost materials out to the actual compost on a regular basis, like daily.
Having the top pop off by itself to relieve gas pressure would be a sign that you need to take it out more often than you are. If you had a spark or a candle just in the right spot at that moment, I suppose you might manage ignition.
If it's really well sealed you could store it in the refrigerator or freezer and that would pretty much eliminate the possibility, as the methane bacteria like it warm and anaerobic. But you want a near-perfect seal or you risk tainting your food. Not using a tightly sealed container solves the issue by keeping it aerobic.