Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from aasaru/multi-stage-docker-build
Browse files Browse the repository at this point in the history
FINCN-170 create multi-stage Docker build
  • Loading branch information
Anh3h authored Aug 20, 2019
2 parents 5b6190a + b433c8e commit 7b761e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
10 changes: 0 additions & 10 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 identity_port=2021

Expand All @@ -25,6 +32,7 @@ ENV server.max-http-header-size=16384 \
server.port=$identity_port

WORKDIR /tmp
RUN wget -O identity-service-boot-0.1.0-BUILD-SNAPSHOT.jar https://mifos.jfrog.io/mifos/libs-snapshot/org/apache/fineract/cn/identity/service-boot/0.1.0-BUILD-SNAPSHOT/service-boot-0.1.0-BUILD-SNAPSHOT.jar

CMD ["java", "-jar", "identity-service-boot-0.1.0-BUILD-SNAPSHOT.jar"]
COPY --from=builder /builddir/service/build/libs/service-0.1.0-BUILD-SNAPSHOT-boot.jar ./identity-service-boot.jar

CMD ["java", "-jar", "identity-service-boot.jar"]

0 comments on commit 7b761e6

Please sign in to comment.