There's a bunch of lights with dedicated rack mounts.
Cateye reflex is a good option because you don't have to remember to turn it on and it has a built in reflector.
https://cateyeamerica.com/products/reflex-auto
Cygolite have a rack mount if you want a brighter option.
https://cygolite.square.site/product...&category_id=4