How do I package and run docker image with plain server

263 views
Skip to first unread message

Tan Tran

unread,
May 20, 2021, 11:38:37 AM5/20/21
to HAPI FHIR
Hi,
I started my project with the plain server sample. the project now is completed. I am able to run in my local with "mvn jetty:run" . it is now time to build a docker image and run in container in AWS. With the springboot app the starting point is the main class and can be easily run with the java -jar command but with the plain server set up
How do build the docker image and run it ?
what do I need to add to the pom? (build tag)
what is my dockerfile looks like?

please advice
I attached my pom
pom.xml

granada Coder

unread,
May 21, 2021, 8:45:52 AM5/21/21
to HAPI FHIR
This question is really outside the scope of "hapi fhir".

Your question is move "how to I dockerize a java/mvn project".

I would suggest stackoverflow.com or other technical forums.

Tan Tran

unread,
May 21, 2021, 11:37:09 AM5/21/21
to HAPI FHIR
Nevermind,   I have figured it out. for those who is wondering how it is done is simply add the src and the pom to the image and run the jetty command as you normally do in the local. Here is my Dockerfile

FROM maven:3.6.3-jdk-11-slim
WORKDIR /hapi-fhir
COPY pom.xml .
ADD ./src/ ./src
RUN ls
EXPOSE 8080
CMD ["mvn","jetty:run"]

Reply all
Reply to author
Forward
0 new messages