To make sure that your Play! Application binds on an IPv4 Socket in your Docker-Container, add the following to your build.sbt file
javaOptions in Universal ++= Seq( // docker
....
"-Djava.net.preferIPv4Stack=true"
)
javaOptions in run += "-Djava.net.preferIPv4Stack=true" // dev mode
Code language: JavaScript (javascript)
when running locally, you can also start sbt and tell it to prefer the IPv4 Stack.
sbt -J-Djava.net.preferIPv4Stack=true
Code language: Bash (bash)