I have the following for a docker file...
FROM openjdk:11-jdk-slim
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT [\"java\",\"-Dexternal.config
The typical issue that occurs when dockerizing a web service (here, a Java Spring Boot application) is that the localhost
address shouldn't be used and replaced with 0.0.0.0
.
For more details, see this SO answer that explains well what represents localhost
in the context of Docker.
Regarding the 0.0.0.0
address, this special IP just means here "any IPv4 address".
Finally as the OP confirmed in a comment, for Spring Boot it suffices to assign the server.address
property in the application.properties
file to achieve this (cf. documentation).