It’s made for Hollywood: the story of an average American family man, captain of a cargo ship in dangerous waters, his vessel overtaken by armed Somali pirates demanding ransom, saving his crew by allowing himself to be removed from the boat and taken hostage.

All of this is the basis for “Captain Phillips,” starring Tom Hanks as the titular, real-life hero. The only problem, say some members of the real Capt. Phillips’ crew, is none of it is true.

Capt. Richard Phillips, they say, is no hero, and the film is one big lie.

The Maersk Alabama leaving the Port of Mombasa, Kenya in 2009.AP Photo/Sayyid Azim

“Phillips wasn’t the big leader like he is in the movie,” says one crew member, who, for legal reasons, spoke with The Post anonymously. He worked very closely with Phillips on the Maersk Alabama and was alarmed by his behavior from the beginning. Phillips, he says, had a bad reputation for at least 12 years prior, known as a sullen and self-righteous captain.

“No one wants to sail with him,” he says.

After the hijacking, 11 crew members have sued Maersk Line and the Waterman Steamship Corp. for almost $50 million, alleging “willful, wanton and conscious disregard for their safety.” Phillips is a witness for the defense.

“The crew had begged Captain Phillips not to go so close to the Somali coast,” said Deborah Waters, the attorney who brought the claim. “He told them he wouldn’t let pirates scare him or force him to sail away from the coast.”

‘REAL ARROGANT’

Phillips had taken command of the Maerskin late March 2009. Left for him, says the crew member, was a detailed anti-piracy plan now used by all ships per the International Maritime Organization. Should pirates get too close, the crew should cut the lights and power and lock themselves below deck.

“He didn’t want anything to do with it, because it wasn’t his plan,” says the crew member. “He was real arrogant.” Phillips says he knows nothing about such a plan.

Over this three-week period, 16 container ships in the same region had been attacked by pirates, and eight had been taken hostage.

As the film opens, Hanks, as Phillips, is seen assiduously tending to safety protocols. “Let’s tighten up security!” he orders. “I want everything closed, locked, even in port.”

Phillips has admitted that, on board, he got seven e-mails about increased piracy off Somalia — each exhorting ships to move farther offshore by at least 600 miles.

The Maersk was 235 miles off the coast, says the crew member, though Phillips has since rounded that number up to 300.

In 2010, Phillips told CNN the Maersk was 300 miles off shore; published reports from that time had the ship at 240.

Phillips ignored every missive and later admitted he didn’t share these warnings — though they were not sent exclusively to him.

Meanwhile, another crew member was tasked with keeping track of every ship in the region that had been attacked. Using the e-mails, a chart was built. On it were the names of each ship, the dates and times they were assaulted, their latitude and longitude, the ransom demanded.

When presented with this data, a crew member says, Phillips ignored it, too. In the film, Hanks tells his crew — depicted as lazy coffee guzzlers who fall back on the security of their union-protected employment — that their job is to get the cargo ship from Point A to Point B in the shortest, cheapest time possible.

In fact, says this crew member, the Maersk veered off course by 180 degrees south — this was during the first attack, on April 8. Phillips denies this, and says the boat only picked up speed.

“We had two pirate attacks over 18 hours,” says this crew member, not just the one shown in the film.

The crew didn’t know whom to fear more: the pirates or Phillips.

According to this crew member, during the first attack, as two pirate boats came into view, clearly chasing them, Phillips was putting the crew through a fire drill. In the film, it’s a security drill.

“We said, ‘You want us to knock it off and go to our pirate stations?’ ” the crew member recalls. “And he goes, ‘Oh, no, no, no — you’ve got to do the lifeboats drill.’ This is how screwed up he is. These are drills we need to do once a year. Two boats with pirates and he doesn’t give a s- -t. That’s the kind of guy he is.”

At first, Phillips maintains this is a lie. “No,” he says. “The mate called up and said, ‘Do you want to stop the drill?’ They [the boats] were seven miles away. There was nothing we could do. We didn’t know the exact situation.”

But is it true that he ordered the entire drill completed anyway?

“Correct,” Phillips says.

“Yeah, seven miles. What’s the dif?” the crew member says. “I saw them, and they were closer than that.”

The Maersk eventually made a narrow escape, and Phillips ordered it back to its original route.

One of the crew mutinied — he refused to do it, instead going below deck, sleeping with his boots on and his flashlight by his side, waiting for the inevitable.

At 3 a.m., the pirates radioed the boat to stop; Phillips had left the stern light on and the bridge open. At 7 a.m., came the third and final attack: Four armed Somali pirates stormed the Maersk.

The crew was on their own. “Phillips didn’t say what he wanted to do,” says the crew member. “His plan [was], when the pirates come aboard, we throw our hands in the air and say, ‘Oh, the pirates are here!’ The chief engineer said, ‘We’re going downstairs and locking ourselves in.’ One of the mates said, ‘Let’s go down. We’re on our own.’ ”

They hid in the engine room, in 130 degree heat, for 12 hours. Phillips and three other crew members were held at gunpoint, yet Phillips tells The Post things weren’t that dire. “The ship,” he says, “was never actually taken.”

DEATH WISH

Chief Engineer Mike Perry, who has a small presence in the film, was perhaps the most heroic. He led most of the crew downstairs and locked them in; he disabled all systems; he attacked the chief pirate, seizing him and using him as a bargaining chip for Phillips.

Most of this is accurately depicted in the movie — until, Perry has said, the moment of exchange, when the Maersk crew tries to swap the pirate for Phillips.

“We vowed we were going to take it to our graves, that we weren’t going to say anything,” Perry told CNN in 2010. “Then we hear this p.r. stuff about him giving himself up . . . and the whole crew’s like, ‘What?’ ”

“If you’re gonna shoot somebody, shoot me!” Hanks pleads in the film.

It didn’t go down like that, say several crew members: The pirates just reneged on the deal, grabbing their guy and making off with Phillips in a Maersk lifeboat.

While the remaining crew waited for the Navy to reach them, they sat and wondered: What just happened?

Four days later, Phillips was rescued by SEAL Team Six. He was hailed as an American hero. He met with President Obama in the Oval Office and wrote a memoir.

For some of the crew, it was too much. In their version, Phillips was the victim of a botched exchange. In 2009, he told ABC News he was taken after promising to show the pirates how to operate their escape boat. His book was packaged as the story of a man who gave himself up for his crew, which Phillips later said was a false narrative spread by the media. Today he tells The Post, “I was already a hostage,” but remains vague on the exchange.

Perry and third engineer John Cronan went to CNN, speaking of Phillips’ recklessness, claiming he endangered all their lives.

Perry said he and other crew believed Phillips had a perverse desire to be taken hostage. “That’s what many of us officers were saying to ourselves,” he said.

The crew member, who is not part of the suit, agrees Phillips had a death wish: “Yeah,” he says. “Because he went through that area, and the company is sending him e-mails, and I know he saw that chart [of prior attacks] 50 times.”

“It is galling for them to see Captain Phillips set up as a hero,” Waters said. “It is just horrendous, and they’re angry.”

In the run-up to Friday’s release of “Captain Phillips,” Hanks has appeared on the cover of Parade magazine with Phillips and the headline “The Making of an American Hero.” The film won the opening-night slot at the New York Film Festival on Sept. 28 and opened the London Film Festival last Wednesday. It has won raves, all of which note the film is based on real events. The two men have walked the red carpet together.

Not all of the crew cooperated with the movie, and those who did were paid as little as $5,000 for their life rights by Sony and made to sign nondisclosure agreements — meaning they can never speak publicly about what really happened on that ship.

It’s the film’s version of events — and Hanks’ version of Phillips — that will be immortalized.

“They told us they would change some stuff,” says the crew member, laughing. By the end of Friday, opening day, he had seen the film. “It’s a good movie,” he says dryly. “Real entertaining.”