Short answer. Yes. Article 31 of the Family Code lets a ship captain solemnize a marriage in articulo mortis between passengers or crew members not only while the ship is at sea, but also during stopovers at ports of call. Being docked at port during a stopover does not remove the captain's special authority.
What the law says
A marriage in articulo mortis between passengers or crew members may also be solemnized by a ship captain or by an airplane pilot not only while the ship is at sea or the plane is in flight, but also during stopovers at ports of call.
Family Code, Article 31 — Marriage in Articulo Mortis Aboard Ship or Aircraft. Read the full provision →
What the article actually authorizes
Article 31 answers your question in a single sentence, without qualification. A marriage in articulo mortis between passengers or crew members may also be solemnized by a ship captain or by an airplane pilot not only while the ship is at sea or the plane is in flight, but also during stopovers at ports of call. The captain's authority to solemnize an in-extremis marriage extends beyond the ship being underway.
Why the article specifically addresses stopovers
Without this article, someone might assume the captain's special authority to solemnize marriage exists only because the ship is at sea and no ordinary solemnizing officer is available. Article 31 removes that assumption directly by extending the same authority to stopovers at ports of call, where the ship is docked and other officials might, in theory, be reachable nearby on land.
Why this matters for a dying passenger at port
If a passenger is in articulo mortis — at the point of death — while the ship happens to be stopped at a port rather than out on open water, Article 31 means the captain does not lose the authority to solemnize the marriage simply because the vessel is docked. The urgency of the situation, not the ship's location relative to open water, is what the article is built around, which is why the same authority follows the passenger's medical emergency rather than the vessel's navigational status.
Who the article covers, and what it requires
Article 31 applies to a marriage between passengers or crew members aboard the vessel itself, and the same special authority is given to an airplane pilot for a marriage aboard a plane in flight. The article addresses who may solemnize the marriage and under what circumstances; it does not itself detail every other requirement that an in-extremis marriage must otherwise satisfy under the rest of the Family Code, which the captain and both parties would still need to carefully observe.