You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by an...@apache.org on 2019/08/20 13:37:08 UTC
[fineract-cn-teller] branch develop updated: FINCN-170 create
multi-stage Docker build (#14)
This is an automated email from the ASF dual-hosted git repository.
angeh pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-teller.git
The following commit(s) were added to refs/heads/develop by this push:
new 030ae07 FINCN-170 create multi-stage Docker build (#14)
030ae07 is described below
commit 030ae0778c67c29716716fd02dded979609c845f
Author: aasaru <aa...@gmail.com>
AuthorDate: Tue Aug 20 16:37:04 2019 +0300
FINCN-170 create multi-stage Docker build (#14)
* FINCN-170 create multi-stage Docker build
* FINCN-170 fix jar path
---
.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 b9f8933..0e45910 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 teller_port=2028
@@ -25,6 +32,6 @@ ENV server.max-http-header-size=16384 \
server.port=$teller_port
WORKDIR /tmp
-COPY teller-service-boot-0.1.0-BUILD-SNAPSHOT.jar .
+COPY --from=builder /builddir/service/build/libs/service-0.1.0-BUILD-SNAPSHOT-boot.jar ./teller-service-boot.jar
-CMD ["java", "-jar", "teller-service-boot-0.1.0-BUILD-SNAPSHOT.jar"]
+CMD ["java", "-jar", "teller-service-boot.jar"]