To add to
@Vidkjaer dockyards are a type of factory and are state buildings, which take up industry slots. They build new ships. They don't have levels.
Makes complete sense that a country like Estonia should not be able to build aircraft carriers just because they have the tech. It would be cool to have to invest in naval infrastructure to construct such ships.
Any country that researched the tech has the choice to build carriers. But using one dockyard is going to take you many years to complete the production, beyond the end of the game. You do have to properly invest - by constructing more dockyards. Since you can only construct dockyards in a coastal state, and factory slots might be very limited because of the type of state, then a small country should find it very difficult even to get enough dockyards to make a few DD and CLs.
Ports are also naval bases. They are not factories, and can't produce new ships. They are province buildings, and aren't affected by the factory slots. You can have dockyards in a coastal state, like the state Rotterdam is in, plus have a port in Rotterdam province.
Ports/naval bases do have levels. These affect the throughput of supplies when used to supply your forces overseas. The ports in Dutch East Indies would limit the number of units (army, naval and planes) that can be located there, before they suffer supply penalties. The higher the level of port, the more supplies your convoy ships can bring in.
The level of the port also affects the capacity of it to handle large fleets. The higher the level the more naval ships can be based there.
Ships that are damaged in combat can be repaired at their home naval base (ie. a port) not at dockyards.
The phrase dockyard is slightly confusing. In Britain we generally refer to facilities to build new ships as shipyards. Dry docks, like the one pictured at St Nazaire, aren't used to build ships, but can be used to repair ships. Private companies with those facilities are "ship repair yards", they often exist side by side with "shipyards". However, the government traditionally has had "naval dockyards" which had facilities to both repair and build some naval ships. But most of the Royal Navy was built by private companies in shipyards, and most repairs carried out by private companies in ship repair yards.
Paradox have gone with "dockyards" to mean factories which build new ships. So the dry dock at St Nazaire is not a "dockyard" in the game sense. It is part of the port/naval base facilities that could be used to load/unload convoys, and repair ships.
The raid on St Nazaire by commandoes IRL was to prevent the Tirpitz being based there. The game equivalent of deploying it to a new home base, where it can get repairs. The very big dry dock was the only one on the Atlantic coast big enough to take Tirpitz. It was rammed by an old DD packed full of explosives, which then destroyed the dry dock. It was eight years before it could be fully repaired. The commandoes also blew up cranes, warehouses, and generally caused as much chaos in the port as they could before escaping. Unfortunately such actions are below the level of the game to represent.
The port capacity of St Nazaire can probably be reduced by bombing. But it won't really matter if Tirpitz operates alone.
However, the port facilities at St Nazaire also included the nearby massive concrete structures built to support the U-boat campaign in the North Atlantic.
These weren't attacked in the commando raid IIRC. Building these (which with similar facilities at Brest and Lorient was a huge construction project IRL, one of the biggest undertaken by Germany during the war) would be simulated in the game by increasing the port/naval base level. Although that would have the effect of allowing greater supply throughput (which is not realistic), it would simulate the increased capacity of the naval base to hold large numbers of subs, so they can operate efficiently in the North Atlantic.
The commandoes didn't attack the sub base, but the RAF did. Attempting to destroy it with some of the biggest bombs dropped in the war. But the double layer of reinforced concrete on the roof managed to withstand even this.
They gave up once it was found easier to just bomb the subs as they left or returned through the Bay of Biscay, once Enigma was revealing their general positions and bombers had radar fitted in them.
Tirpitz never entered the Atlantic because of the raid, remained in Norway, where eventually those massive bombs dropped by the RAF found their target.