The victims, some as young as 15, had desperately tried to sound the alarm about the lack of oxygen in the container on its journey from Belgium to the UK, the Old Bailey heard.
They were later found dead by Maurice Robinson, a lorry driver who had gone to collect the trailer from Purfleet Docks, Essex.
Robinson and one of the smuggling gang’s leaders Ronan Hughes, both from Northern Ireland, admitted their roles in the smuggling scheme and also confessed to 39 counts of manslaughter.
The other ringleader Gheorghe Nica, from Basildon, Essex, and accomplice Eamonn Harrison, from County Down, who had collected the victims in Europe, were convicted of the same offences in December.
Nica and Hughes received sentences of 27 and 20 years respectively. Robinson, who also pleaded guilty to money-laundering, was handed 13 years and four months, while Harrison was given 18 years in prison.
After handing down the jail terms, Mr Justice Sweeney told the four men that they would serve two-thirds of their sentences, rather than the usual half.
The court heard that the gang carried out at least seven smuggling operations between May 2018 and 23 October 2019, some of which were prevented by UK border officials.
The people-smugglers stood to receive more than £1m in October 2019 alone, with each migrant due to pay between £10,000 and £13,000 once they reached a safe house in the UK.
In his sentencing remarks, Mr Justice Sweeney said: “I have no doubt that, as asserted by the prosecution, the conspiracy was a sophisticated, long-running and profitable one to smuggle mainly Vietnamese migrants across the channel.”
He also said that the 39 victims had no means of escape and had died an “excruciating death”, adding that their willingness to “try and enter the country illegally provides no excuse for what happened to them”.
Three other people involved in the transporting of migrants – but not of those who died – were also sentenced on Friday. Christopher Kennedy, Valentin Calota and Alexandru-Ovidiu Hanga received seven, four-and-a-half and three-year terms respectively.
Ahead of Friday’s sentencing, the families of the victims spoke of their grief. Tran Hai Loc and his wife Nguyen Thi Van, the parents of two young children, were among those who lost their lives in the lorry.
Tran Dinh Thanh, the children’s grandfather, said: “Everyday, when they come home from school they always look at the photos of their parents on the altar.”
Their parents’ deaths were a “big loss to them”, he added.
Additional reporting from PA