Leixões is the only port in the Porto Area capable of handling Cruise Liners of any size. According to the Port Authority website Passenger/Cruise vessels come alongside at Quay Nº. 1 on the North side of the main basin, which also happens to lie within the boundaries of the parish of Leça da Palmeira, which, in turn is a parish of Matsinhos.
See this map from the Port of Leixões Authority website:https://www.apdl.pt/gca/index.php?id=187
The Metro from Porto (Line 4/Blue Line - direction Sr. de Matsinhos) runs along the south side of the port. There is a halt at "Mercado" which is close to the bridge across the river. It appears from Google street view that there are stairs from the pedestrian walkway on the West side of the bridge down to street level on the North - West Side approximately 3/4 of the way across. Remember when dealing with ports that distances are deceptive. What appears a 500m walk may end up 1km because of fences etc.
The bus route 507 does not run near the Castelo do Queijo which is located at Praça Gonçalves Zarco, 4100-274 Porto. See map:http://goo.gl/maps/1t77F
See this google map: http://goo.gl/maps/fgF2j
I have checked with the online site of stcp.pt, the Porto Bus Company. There is no direct bus service from the North Side of the Port.
However, if you walk over the the famous bridge, turn right and in front/near "Mercado" metro stop there is a bus stop (São Pedro) served by Bus lines 502 (Direction) BOLHÃO and 500 (Direction) LOIOS. Descend at CASTELO DO QUEIJO bus stop.
It is also possible to get the 507 bus from the North Side near the passenger terminal, (Bus stop Fresca) change at "Mercado" to either the 502 or 507 as above.