Skip to content
Permalink
Browse files
FINCN-170 create multi-stage Docker build (#14)
* FINCN-170 create multi-stage Docker build

* FINCN-170 fix jar path
  • Loading branch information
aasaru authored and Anh3h committed Aug 20, 2019
1 parent 69d3c83 commit 030ae0778c67c29716716fd02dded979609c845f
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 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"]

0 comments on commit 030ae07

Please sign in to comment.