I am building a Spring Boot application, which has a few different REST endpoints. It can be locally packaged and launched as a jar file successfully. When running locally, I can access its endpoints via "http://localhost:8080/endpoint?params..". I was tasked with now preparing this application to run off of Dockers. Still working on my local machine, I have created a Dockers container based off of the Java:8 image. In this container, I have been able to run my application from the .jar successfully. My issue is, I do not understand how to call to the REST endpoints inside the application, when the application is hosted off of Docker, since logically localhost:8080/endpoint is no longer responsive to the call.
Side information: My local computer is Windows, the Docker image is Ubuntu (eventually will be launched onto a Linux server).
UPDATE: Created a new image with the following Dockerfile:
FROM openjdk:8
MAINTAINER My Name email@email.com
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
EXPOSE 8080
RUN javac Main.java
CMD ["java", "Main"]
Same issue, cannot access endpoint via http://localhost:8080/endpoint
Any help will be appreciated. Thank you!