The 24-year-old Duminy hit one six and 12 fours off 234 balls and shared a 155-run opening stand with skipper Graeme Smith who made 87.
Duminy then added a further 137 with Hashim Amla who scored 55 as the Proteas grabbed plenty of time in the middle ahead of the third Test which starts in Birmingham on Wednesday.
"JP is a fantastic cricketer. We are really privileged to have a young batter like that waiting in the wings," said South Africa coach Mickey Arthur.
"I'm hugely comfortable that our batting in a reserve strength is very, very well looked after.
"He's batted out of position. He normally bats at four so I'm happy that he has the ability to step up at any time if there is an injury or loss of form."
Bangladesh pacemen Sajidul Islam and Nazmul Hossain caused both Duminy and Smith problems early on at New Road in hot and humid conditions, but once they lost their sting, the South Africans were always on top.
Bangladesh, fielding a side with an average age of just under 20, struck off the final ball before lunch when Smith edged a delivery from spinner Junaid Siddique to wicketkeeper Mushfiqur Rahim.
He notched one six and 11 fours off 88 balls.
Left-hander Duminy, unbeaten on 51 at lunch, was joined by Amla and they pushed the Proteas past the 200 mark.
Duminy completed the ninth first-class ton off 166 balls with one six and eight fours.
Amla was caught on the long-on boundary by Nazmul Hossain off Dhiman Ghosh after stroking four fours off 99 deliveries.
Duminy's innings finally ended when he was run out by a direct hit from mid-wicket by Shakib Al Hasan just three runs short of his career-best after putting a further 68 with Jacques Kallis, who was undefeated with 52.