forked from OpenBankProject/OBP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip #1 add initial dockerfile via https://github.com/tawoe/OBP-API/tr…
- Loading branch information
1 parent
4264d5f
commit 1bebaa0
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM maven:3-jdk-8 as maven | ||
# Build the source using maven, source is copied from the 'repo' build. | ||
ADD . /usr/src/OBP-API | ||
RUN cp /usr/src/OBP-API/obp-api/pom.xml /tmp/pom.xml # For Packaging a local repository within the image | ||
WORKDIR /usr/src/OBP-API | ||
RUN cp obp-api/src/main/resources/props/test.default.props.template obp-api/src/main/resources/props/test.default.props | ||
RUN cp obp-api/src/main/resources/props/sample.props.template obp-api/src/main/resources/props/default.props | ||
RUN mvn install -pl .,obp-commons | ||
RUN mvn install -DskipTests -pl obp-api | ||
|
||
FROM openjdk:8-jre-alpine | ||
|
||
# Add user | ||
RUN adduser -D obp | ||
|
||
# Download jetty | ||
RUN wget -O - https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.15.v20190215/jetty-distribution-9.4.15.v20190215.tar.gz | tar zx | ||
RUN mv jetty-distribution-* jetty | ||
|
||
# Copy OBP source code | ||
# Copy build artifact (.war file) into jetty from 'maven' stage. | ||
COPY --from=maven /usr/src/OBP-API/obp-api/target/obp-api-*.war jetty/webapps/ROOT.war | ||
|
||
WORKDIR jetty | ||
RUN chown -R obp /jetty | ||
|
||
# Switch to the obp user (non root) | ||
USER obp | ||
|
||
# Starts jetty | ||
ENTRYPOINT ["java", "-jar", "start.jar"] |