You could use a control panel for this and adjust the bell time or a timer relay eg
https://www.securitywarehouse.co.uk/catalog/intruder-alarm-c-36/intruder-alarm-ancillaries-c-36_46/tkc-160-precision-timer-p-2664.html
https://www.securitywarehouse.co.uk/catalog/access-control-c-27/access-control-ancillaries-c-27_43/tkc-12v-dc-relay-handy-little-relay-p-1576.html
Or a transistor version
https://www.securitywarehouse.co.uk/catalog/intruder-alarm-c-36/door-contacts-switches-c-36_44/knight-g2-surface-contact-with-tact-tamper-and-selectable-res-p-3868.html
Is a surface contact that is compatible