You may need a small spring to keep it in place. its a good idea .  a small spring added to  the hinge and door you  will not have to be slammed it

A simpler self-locking predator-proof sliding chicken coop door concept