How to mount components in a box?

Epoxy works best in my experience, I used to have 1 in 10 separate from the panel until I began roughing up the plastic and fixing a small washer (I like outside star lock washers) and a grey epoxy resin used for automotive repairs called JB Weld. The curing time can be accelerated by heating to 45 deg C or 115 F for 30 minutes.
This was a technique that I used to make field testable models that let me finalize circuit board sizes, mounting holes and cutouts required for a final drawing, PCB layouts (mounting holes) and battery holders for SLA batteries in both plastic and aluminum.

Doc