If the junction box you refer to is on a lighting circuit protected by a 6A mcb or rcbo, or comes from say a 3A fused spur, then you could use that to feed a bell transformer for the doorbell.
You would need to use a transformer that is fully enclosed (ie insulated and with terminals covered)
Many are now designed to fit in the consumer unit, and would need an enclosure, - you could use this sort of thing:
(No personal experience of this supplier, this is an example)
Wylex ESE2 IP40 2-3 Module Insulated Enclosure with BG CUB1 8 to 24 volt bell transformer. Works with most video door bells. for example: Ring, Google Nest, Eufy ESE2 Insulated enclosure for 2/3 Module IP40 rated, protected from tools and small wires greater than 1mm CE/UKCA/WEEE conformity...
sunnyelectricals.co.uk
Depending on the model of your Ring doorbell, you should check the required voltage of the transformer, and/or you may need to include a resistor in series with the connection, all of which is explained by Ring, and info is available on forums.