The ANSA news agency said the explosion Friday destroyed the Bruscella factory in Modugno and that the death toll might rise once firefighters are able to gain full access to the site.
Prosecutor Giuseppe Volpe was quoted as saying it will take at least a day for the flames to go out so firefighters can get inside. Two Canadair firefighting planes were flying overhead to try to douse the fire, which has spread to nearby forests.
The factory was in full swing as many of Italy's small towns celebrate religious festivals at this time of year with fireworks shows.