Are you using Docker Desktop? It uses a headless virtual machine inside host, so connecting to host is tricky.
You may use hostname host.docker.internal
from the container to access host.
edit: link to the docs https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
tankies + fedidrama = classic lemmy