Docker spring boot java FAILED

this is my dockerfile:

FROM maven:3.8.2-jdk-11 AS build
COPY . .
RUN mvn clean package -Pprod -DskipTests
FROM openjdk:11-jdk-slim
COPY --from=build /target/backendaccountant-0.0.1-SNAPSHOT.jar demo.jar
ENV PORT=8087
EXPOSE 8080
ENTRYPOINT [“java”,“-jar”,“demo.jar”]

The application is failed, How is my error?

Hi there,

I’m not overly familiar with Java/Spring Boot but I was able to get this very basic example spun up a while back.

I suspect this is a host/port configuration issue. You could likely remove:

ENV PORT=8087EXPOSE 8080

A port will be set by default to 10000 and be available in the PORT env var. And as per the above example, you’ll need to ensure the server address is configured to 0.0.0.0

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.