use a fire-resistant box of any kind it would have to be sealed to be fully flame resistant.
This would mean that the computer would not be able to release the watts being dissipated. Severe overheating would then see the demise of the computer.
If you wish to run your computer in the loft, I would try to find a heat sensitive device which would trip the mains from the computer should any excessive temperatures be detected.
Unless you have the necessary skills to devise such a system, you would have to seek professional advice.
I would also make sure there are no flammable materials around the system.
Have you a nearby shed you could house the computer? - Probably a lot safer.