I created docker image form my spring boot application.
My Dockerfile looks like this :
FROM java:8
EXPOSE 8080
COPY ./sample-app-3.2.1.war sample-app-3.2.1.war
CMD ["java","-jar", "sample-app-3.2.1.war"]
I am able to create and run the docker image on server with below command:
to build image:
sudo docker build -f Dockerfile -t app:1.0 .
to run image:
sudo docker run -p 8080:8080 app:1.0
but I am not able to access api on my local machine browser.
without docker its working perfectly
I am trying like this :-
suppose server ip is : A.B.C.D
api mapping : api/test