The U.S. destroyer Mullinnix pulled into Djibouti the other day after an extended swing through the Persian Gulf area.

"It's been so long I can't remember when I was last ashore," lamented a young Chicago sailor, looking from the gray decks out at this steamy little former French colony on the Horn of Africa.

Aside from stepping down onto the quay to bargain with coral and t-shirt peddlers, however, the sailors had to be satisfied with raucous talk about an upcoming liberty in Haifa, the northern Israeli port whose attractions have a high reputation aboard the Mullinnix.

The 420-foot destroyer was in Djibouti only long enough to take on fuel and some fresh fruit and vegetables at the outrageous local prices. Then it was back out to sea with the rest of the 7th Fleet, underlining U.S. presence in this area whose strategic importance has grown sharply since the revolution in Iran and the Soviet invasion of Afghanistan.

That is the deal in Djibouti for U.S. ships and planes -- a commercial operation. They come to the protected deepwater harbor or nearby Ambouli airport, they do their business and they move on.

For while tough, expensive and potentially dangerous negotiations are under way in Somalia for base facilities at Berbera about 200 miles south of here, Djibouti has been declared off limits, apparently in a tacit understanding among Djibouti officials, their French patrons and the United States that putting U.S facilities here would be asking for trouble.

It is not for lack of strategic value. Djibouti sits directly on the Bab el Mandeb Strait commanding access between the Red Sea and the Gulf of Aden. Just across the narrow waterway lies South Yemen, a Marxist state that along with Ethiopia immediately to the east gives the Soviet Union a strong military position in the area.

In addition, Djibouti has a fine, deep harbor and a modern airport where jumbo jets land and take off regularly. There would be little need for the expensive renovation necessary at Berbera for use of bunkering and airport facilities left behind by the Soviets.

The seedy charm of Djibouti town -- a Graham Green setting replete with ceiling fans, blistering paint and tired prostitutes -- would certainly win the vote of U.S. personnel to be stationed at the new facility or sailors whose ships would call.

Djibouti, however, has been an independent republic only since June 1977, after a century as a colony of France. Sandwiched uncomfortably between Somalia and Ethiopia and populated by tribal groups with competing loyalties toward the mutually hostile neighbors, its hold on sovereignty remains fragile.

A careful neutrality in the struggle between Somalia and Ethiopia, and in the broader competition for influence and strategic advantage between the United States and the Soviet Union, seems in Somali eyes the only course. A U.S. military base here by any name would tilt that neutrality, perhaps fatally for the young administration of President Hassan Gouled Aptidon.

"It would indicate that Djibouti had made a choice in its relations that it can't really sustain politically," said an experienced diplomat observer here, who added that the subject never has come up officially. "I don't think either Somalia or Ethiopia would allow it."

A symbol of Djibouti's need to follow a narrow course is a 500-mile railway built between Addis Ababa and Djibouti by the French and Ethiopia's major sea outlet: Djibouti port.

Perhaps more importantly, France probably would not allow a tilt either. The French, although they left officially two years ago, are still key to Djibouti as the country or a strategic base. The French population remains about 12,000 out of a total of some 325,000. French teachers, administrators, military instructors and merchants keep the country moving, albeit at a tropical pace befitting the torrid heat.

The French military based here total about 3,650 including 1,000 airmen flying and servicing a dozen Mirage warplanes based at Ambouli, several armored units and about 800 in the 13th Demibrigade of the French Foreign Legion. Although its numbers make it a full brigade, the unit retains its mane, earned when it split between De Gaulle's Free French and the Vichy regime during World War II.

Military expenditures and budget aid from the French bring Djibouti about $200 million a year, in addition to what is spent by the half-dozen French Navy ships that base here in the cool season and move down to Reunion Island off Madagascar in the Indian Ocean, in the scorching summer.

As a result of the presence, Djibouti at night resembles Ft. Bragg, N.C., with crowds of crewcut youths in blue jeans prowling bars and drinking imported beer at $3 a bottle. At Ft. Bragg, however, the temperatures are lower. The language also is different. And the restaurants would be hard put to match the langouste a la mayonnaise with a gris de gris from Provence served at the Palmier en Zinc Bar.

The French military presence, although definitely Western, somehow has not aroused criticism from the Marxist governments in Addis Ababa and Aden.

Although Ethiopian leader Mengistu Haile Mariam has threatened to bomb any U.S. facilities at Berbera, he has said nothing of note about the French in Djibouti, whose military establishment far outstrips anything Washington has planned for Berbera just down the coast.

This perhaps is because France's interests in Africa are seen as long-term and, on the whole, beneficial, while the U.S. interest in the region is regarded as a short-term tactical response to Iran and Afghanistan, an observer speculated.

President Valery Giscard d'Estaing made a show of sending some Mirages nonstop from Paris to Djibouti, refueling in midair, on the eve of his recent trip to the Persian Gulf, apparently to impress his hosts with French military capabilities, the observer added. But at the same time, the French are not seen as part of the U.S.-Soviet standoff, and Frenchmen sipping anisette on a veranda here appear more acceptable than Americans drinking beer on a beach at Berbera.