I am using windows 10 enterprise version and i have tested docker hello world web app it works just fine.
Dockerfile
FROM adoptopenjdk/openjdk11:latest
WORKDIR /app
COPY ./ ./
EXPOSE 3000
CMD ["java", "-jar", "app.jar"]
These are the steps i followed:
Now inside container i am able to access the app using curl command on port 3000 But from my local machine when i do http://localhost:3000 it says page is not working. Any help is appreciated ?
After further debugging i found my server was only bound to localhost i.e. server connector was only listening on localhost and that's why it worked inside only container. I bound internal network interface(which resolved to an ip) to my server along with localhost(this is happening during server start-up), after this i was able to access the app from outside the container.