Skip to content
Permalink
Browse files
Merge pull request #10 from aasaru/multi-stage-docker-build
FINCN-170 create multi-stage Docker build
  • Loading branch information
awasum committed Sep 2, 2019
2 parents 59aade7 + 65c2237 commit 4792359fe4afaed9ddd98a7b45fc7f76d8f7b9bb
Showing 2 changed files with 10 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 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/service-0.1.0-BUILD-SNAPSHOT-boot.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"]

0 comments on commit 4792359

Please sign in to comment.