I had a simple rule with my dogs, I accommodated them.
If they got into the garbage, it's because I left it out for them to get to. What I'd recommend is have a spring on your door so it will pull itself shut.
Dogs are too goofy and good natured to be mad at or to get frustrated with.
#humor