Ok, I got it working.
I thought it was a problem with the default bridge network from docker because I’ve created another bridge network and then started the container using the flag --network new_bridge
and it worked.
Then I’ve tried again with the default bridge network and it worked, so I’m clueless about what the issue was
Anyway, hope this helps somebody who might face the same problem.