I have built a RESTful Web Service using with Spring (Maven) referring to this guide and it works great:
https://spring.io/guides/gs/rest-service/
Now I wanted to launch this in a container using Docker and I'm hitting the issue. See below my Dockerfile:
#Take the base Java image to build upon
FROM openjdk:11
#Expose the container port that your application listens to outside world
#In the Sample application you can find this under Application.properties
EXPOSE 9090
#Add our application Jar file to the package
ADD target/demo-0.0.1-SNAPSHOT.jar demo.jar
# Run the application
ENTRYPOINT ["java", "-jar", "demo.jar"]
I build and run this using commands:
docker build -t username/demo.jar .
docker run -p 80:9090 username/demo.jar
I checked the application.properties
file and it is empty. I dunno if something needs to be set here.
How can I correct this?