Skip to content
Permalink
Browse files
Merge pull request #13 from aasaru/multi-stage-docker-build
FINCN-170 create multi-stage Docker build
  • Loading branch information
Anh3h committed Aug 20, 2019
2 parents 5b6190a + b433c8e commit 7b761e628c94ba2a81aab869d7bfe6ba36e0f798
Showing 2 changed files with 11 additions and 13 deletions.
@@ -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
@@ -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

@@ -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.