From b613a9f9baf7989e243c42d96759aa3920ded037 Mon Sep 17 00:00:00 2001 From: tawoe Date: Thu, 26 Nov 2020 13:19:26 +0100 Subject: [PATCH] feature/switch docker to jetty image, loglevel from env --- Dockerfile | 21 ++++--------------- .../resources/container.logback.xml.example | 12 +++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 src/main/resources/container.logback.xml.example diff --git a/Dockerfile b/Dockerfile index 433e5888..091ba31b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,28 +3,15 @@ FROM maven:3-jdk-8 as maven WORKDIR /usr/src COPY pom.xml . COPY src src -#Copy default props file +# .Copy default props file COPY src/main/resources/props/sample.props.template src/main/resources/props/default.props +COPY src/main/resources/container.logback.xml.example src/main/resources/default.logback.xml RUN mvn -e -B dependency:resolve RUN mvn -e -B package -# Stage two: openjdk -FROM openjdk:8-jre-alpine - -# Add obp user -RUN adduser -D obp - -# Download jetty TODO: Use jetty image -RUN wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.15.v20190215/jetty-distribution-9.4.15.v20190215.tar.gz -RUN tar xvf jetty-distribution-9.4.15.v20190215.tar.gz +FROM jetty # Copy source from maven build stage -COPY --from=maven /usr/src/target/API_Explorer-1.0.war jetty-distribution-9.4.15.v20190215/webapps/ROOT.war - -WORKDIR jetty-distribution-9.4.15.v20190215/ -# Switch to the obp user (non root) -USER obp +COPY --from=maven /usr/src/target/API_Explorer-1.0.war /var/lib/jetty/webapps/root.war EXPOSE 8080 -# Start jetty -ENTRYPOINT ["java", "-jar", "start.jar"] diff --git a/src/main/resources/container.logback.xml.example b/src/main/resources/container.logback.xml.example new file mode 100644 index 00000000..ef652a72 --- /dev/null +++ b/src/main/resources/container.logback.xml.example @@ -0,0 +1,12 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss} %t %c{0} [%p] %m%n + + + + + + +