Update Dockerfile
Signed-off-by: Billy Brawner <billy@wbrawner.com>
This commit is contained in:
parent
ac7d7d6e3d
commit
591cf9d4fe
1 changed files with 18 additions and 5 deletions
23
Dockerfile
23
Dockerfile
|
@ -1,6 +1,19 @@
|
|||
FROM openjdk:8-jdk
|
||||
FROM openjdk:8-jdk as builder
|
||||
MAINTAINER Billy Brawner <billy@wbrawner.com>
|
||||
ADD . /usr/share/budget/budget-api
|
||||
WORKDIR /usr/share/budget/budget-api
|
||||
RUN /usr/share/budget/budget-api/mvnw -Dmaven.test.skip=true package
|
||||
ENTRYPOINT ["/usr/bin/java", "-jar", "/usr/share/budget/budget-api/target/budget-api.jar"]
|
||||
|
||||
RUN groupadd --system --gid 1000 maven \
|
||||
&& useradd --system --gid maven --uid 1000 --shell /bin/bash --create-home maven \
|
||||
&& mkdir /home/maven/.m2 \
|
||||
&& chown --recursive maven:maven /home/maven \
|
||||
&& ln -s /home/maven/.m2 /root/.m2
|
||||
|
||||
COPY --chown=maven:maven . /home/maven/src
|
||||
WORKDIR /home/maven/src
|
||||
RUN /home/maven/src/mvnw -DskipTests package
|
||||
|
||||
FROM openjdk:8-jdk-slim
|
||||
EXPOSE 8080
|
||||
COPY --from=builder /home/maven/src/target/budget-server-0.0.1-SNAPSHOT.jar budget-server.jar
|
||||
ENTRYPOINT ["/usr/local/openjdk-8/bin/java", "-Xmx3g", "-jar", "/budget-server.jar"]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue