-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [java-ci]: updated ci * [java-ci]: updated ci * updated ci * ci * ci * ci * FIXED DOCKER
- Loading branch information
Showing
3 changed files
with
42 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
### Build stage | ||
# Builder gradle | ||
FROM gradle:jdk21-alpine AS builder | ||
FROM azul/zulu-openjdk-alpine:21 AS builder | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
WORKDIR /upacked | ||
|
||
# Copy the source code into the container | ||
COPY . . | ||
|
||
# Build | ||
RUN gradle clean unpack -x test | ||
RUN ./gradlew clean unpack -x test | ||
|
||
# Unpack the jar | ||
ARG UNPACKED=build/unpacked | ||
COPY ${UNPACKED}/BOOT-INF/lib /app/upacked/lib | ||
COPY ${UNPACKED}/META-INF /app/upacked/META-INF | ||
COPY ${UNPACKED}/BOOT-INF/classes /app/upacked | ||
|
||
COPY ${UNPACKED}/BOOT-INF/lib /upacked/lib | ||
COPY ${UNPACKED}/META-INF /upacked/META-INF | ||
COPY ${UNPACKED}/BOOT-INF/classes /upacked | ||
|
||
### Run stage | ||
# Create a minimal production image | ||
FROM azul/zulu-openjdk-alpine:21-jre-headless | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /upacked | ||
WORKDIR / | ||
|
||
# Avoid running code as a root user | ||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup | ||
USER appuser | ||
|
||
# Copy only the necessary dirs and files from the builder stage | ||
COPY --from=builder /app/upacked /upacked/app | ||
COPY --from=builder /upacked ./app | ||
|
||
# Run the binary when the container starts | ||
CMD ["java", "-cp", "app:app/lib/*", "vlaship.backoffice.App"] | ||
ENTRYPOINT ["java", "-cp", "app:app/lib/*", "dev.vlaship.backoffice.App"] |