Make sure the humidity is higher. Lower humidity = more static electricity buildup.

Also, you can touch something grounded (like that doorknob) with a metal implement you're touching (like a key) to more gently discharge the static.

I'd suggest grounding yourself like that frequently (to keep the charge from building very much).