Without understanding your setup completely, is the callback happening in a server-to-server call? If so, localhost doesn't work.
For example when I wanna call the elastic search container from fusion auth, I cannot call it as http://localhost:9200. For instance if the setup is
fusionauth-search:
image: docker.elastic.co/elasticsearch/elasticsearch:8.5.0
container_name: fusionauth-search
environment:
cluster.name: fusionauth
networks:
- data-layer
restart: unless-stopped
ports:
- '9011:9011'
I will need to call it via http://fusionauth-search:9200
. You can also see such a setup in Fusion Auth's documentation on setting up Fusion Auth in docker-compose at https://fusionauth.io/docs/v1/tech/installation-guide/docker. You notice that the URLs will refer to the container names.
I hope this helps.