Here's a down and dirty trick. Use a spdt contact for the door switch, a big capacitor, 12-24 VDC, common door chime. Feed the +DC to the doorswitch contact that is normally closed when the door is closed. Connect the capacitor (+) to the common terminal of the switch. Connect the door chime to the switch contact that is open when the door is closed. Connect the capacitor ( - ), the -DC and other side of the chime together.
With the door closed, the capacitor charges, When the door is open, the capacitor charge is switched to the door chime and it rings one time. When the door is closed again, the process starts over.
Note: Put an on/off switch where convenient and break one side of the the dc power or a chime lead. Change the value of the capacitor for more or less chime striking force. Use a recessed, surface mount or motion switch as desired.
Hope this helps!