Explanation
This shock is caused by static electricity transferring between an area of higher concentration (your body) to an area of lower concentration (the doornob). The doornob is metal and a good conductor of electricity which facilitates this transfer.