forked from stakater-lab/stakater-nordmart-review-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (26 loc) · 1.02 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#################################################################################
##### BUILD
#################################################################################
FROM maven:3.8.6-openjdk-11-slim AS build
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml clean package
#################################################################################
##### RUN
#################################################################################
FROM registry.access.redhat.com/ubi8/openjdk-11:1.14-10
LABEL name="inventory" \
maintainer="Stakater <[email protected]>" \
vendor="Stakater" \
release="1" \
summary="Java Spring boot application"
# Set working directory
ENV HOME=/opt/app
WORKDIR $HOME
# Expose the port on which your service will run
EXPOSE 8080
# NOTE we assume there's only 1 jar in the target dir
COPY --from=build /usr/src/app/target/*.jar $HOME/artifacts/app.jar
USER 1001
# Set Entrypoint
ENTRYPOINT exec java $JAVA_OPTS -jar artifacts/app.jar