Skip to content

Commit

Permalink
Merge pull request #8 from telekom/feature/multistage-dockerfile
Browse files Browse the repository at this point in the history
feat: added a multi-stage dockerfile
  • Loading branch information
mherwig authored Mar 8, 2024
2 parents 8f0743d + d85b111 commit fbc1950
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile.multi-stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Deutsche Telekom IT GmbH
#
# SPDX-License-Identifier: Apache-2.0
FROM azul/zulu-openjdk-alpine:21 AS builder

WORKDIR /workspace/app

COPY . .
RUN dos2unix ./gradlew
RUN ./gradlew build -x test

FROM azul/zulu-openjdk-alpine:21-jre

USER root
RUN apk add --no-cache --update gcompat --repository=https://dl-cdn.alpinelinux.org/alpine/v3.18/main/ > /dev/null

USER 1001:1001

WORKDIR /workspace/app

COPY --from=builder /workspace/app/build/libs/starlight.jar app.jar

EXPOSE 8080

CMD ["java", "-jar", "app.jar"]

0 comments on commit fbc1950

Please sign in to comment.