unable to connect to docker container by it’s ip address

Let’s say my WSL instance has an eth0 IP address of 172.18.240.175. If I’m inside the container I can connect to port 80 without issue (eg. php -r "fsockopen('127.0.0.1', 443);") but, outside of the container but whilst still on the Windows 11 WSL host, I am unable to connect. php -r "fsockopen('172.18.240.175', 443);" gives me the following:

Warning: fsockopen(): unable to connect to 172.18.240.175:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
) in Command line code on line 1

Any ideas what’s up with this?