Mohammad Ghazban was punched, hit with a piece of wood and threatened with his own kitchen knife after the gang of six turned nasty. They also broke a door inside the shop, he said.
But the gang eventually fled when he managed to find a button to close the shutters at the premises in Bentley, potentially imprisoning them in the shop if they had remained.
The trouble broke out at the City Pizza takeaway, on Arksey Lane, at around 11.45pm on Monday.
He was in the shop with his cashier, who was not attacked or hurt.
Mr Ghazban said: “They came into the shop and they ordered some food.
“Then they started racially abusing me, using racist language.
“One of them had a coat and initially he started hitting me with it. Then he asked me for a fight
“He had a piece of wood and started banging it on the counter. My driver saw and called the police.”
“They broke the door which separates the shop and the counter and came round to my side of the counter.
“Then one of them smashed into my face, hitting me in the jaw.”
He said they took a knife which he had been using off the table and also picked up a rolling pin. One of the gang threw it at him but he managed to dodge it.
“I feared I was going to be killed,” he said.
But he managed to find the switch that closed the shutters at the front of the shop and the shutters began to close.
When they saw what was happening the men fled. Mr Ghazban believed they feared they would be trapped in the shop and arrested if they did not get out.
Police arrived after they had left.
Mr Ghazban was taken to Doncaster Royal Infirmary for treatment, where he was X-rayed. No serious injuries were found, but he has struggled to use one hand because it was struck by the piece of wood that his attacker was wielding.
He is now taking painkillers.
Now he says he is scared in case his attackers come back and urges anyone with information about who attacked him to come forward.
South Yorkshire Police confirmed they were investigating.
A spokesman said: “Police were called at around 11.30pm on Monday April 25 to reports of an assault in Bentley, Doncaster.
“It is reported that a 28-year-old man was assaulted by two men inside a takeaway in Arksey Lane. He suffered minor injuries.
“An investigation is underway and witnesses are asked to call 101 quoting incident number 1176 of April 25 2016.”