-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
# Use an official Gradle image to build the backend | ||
# Use OpenJDK 17 image | ||
FROM openjdk:17 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy and build the application | ||
COPY . . | ||
RUN gradle build -x test | ||
|
||
# Use a lightweight JRE image for runtime | ||
FROM openjdk:11-jre-slim | ||
COPY --from=build /app/build/libs/*.jar /app/app.jar | ||
|
||
EXPOSE 8080 | ||
CMD ["java", "-jar", "-Dspring.profiles.active=prod", "/app.jar"] | ||
# Copy the built jar file | ||
COPY build/libs/*.jar app.jar | ||
|
||
# Set the entry point to run the application | ||
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=prod", "/app.jar"] |