You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by aw...@apache.org on 2019/09/02 20:44:30 UTC
[fineract-cn-reporting] 45/47: FINCN-170 create multi-stage Docker
build
This is an automated email from the ASF dual-hosted git repository.
awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-reporting.git
commit 13ecc2a6c460ddd837cbb44358dc36dec17afd7f
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Mon Aug 19 19:39:50 2019 +0300
FINCN-170 create multi-stage Docker build
---
.dockerignore | 10 ----------
Dockerfile | 13 ++++++++++---
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/.dockerignore b/.dockerignore
index 8d88495..a3b6dc5 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,17 +1,7 @@
-api/
-component-test/
-gradle/
-gradlew.bat
LICENSE
README.md
-settings.gradle
-build.gradle
docs/
-gradlew
HEADER
NOTICE.txt
-service/
.git/
-.gradle/
.gitignore
-shared.gradle
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 7079e8b..3bfe1bb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,7 +16,14 @@
# specific language governing permissions and limitations
# under the License.
#
-FROM openjdk:8-jdk-alpine
+FROM openjdk:8-jdk-alpine AS builder
+RUN mkdir builddir
+COPY . builddir
+WORKDIR builddir
+RUN ./gradlew publishToMavenLocal
+
+
+FROM openjdk:8-jdk-alpine AS runner
ARG reporting_port=2029
@@ -25,7 +32,7 @@ ENV server.max-http-header-size=16384 \
server.port=$reporting_port
WORKDIR /tmp
-COPY reporting-service-boot-0.1.0-BUILD-SNAPSHOT.jar .
+COPY --from=builder /builddir/service/build/libs/reporting-service-boot-0.1.0-BUILD-SNAPSHOT.jar ./reporting-service-boot.jar
ENV server.port=$reporting_port
-CMD ["java", "-jar", "reporting-service-boot-0.1.0-BUILD-SNAPSHOT.jar"]
+CMD ["java", "-jar", "reporting-service-boot.jar"]