Skip to content

Commit

Permalink
Update Dockerfile to use multi-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Dec 3, 2023
1 parent 9f0fce6 commit 6b2b826
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions k8s/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:11-jdk
MAINTAINER daynnnnn
# syntax=docker/dockerfile:1
FROM eclipse-temurin:11-jdk as build

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

Expand All @@ -25,5 +25,18 @@ RUN sed -i 's|${db.schema}|${env.DB_DATABASE}|g' pom.xml

RUN ./mvnw clean package -Pkubernetes -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"

CMD java -jar target/steve.jar
FROM eclipse-temurin:11-jdk
MAINTAINER daynnnnn

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

ARG DB_HOST
ARG DB_USERNAME
ARG DB_PASSWORD
ARG DB_DATABASE
ARG DB_PORT

COPY --from=build /code/target/steve.jar steve.jar
COPY --from=build /code/libs libs

CMD java -jar steve.jar

0 comments on commit 6b2b826

Please sign in to comment.