-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (16 loc) · 720 Bytes
/
Dockerfile
File metadata and controls
23 lines (16 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use a base image with Gradle installed
FROM gradle:8.7.0-jdk17 AS build
# Set the working directory inside the container
WORKDIR /app
# Copy the application and Gradle files to the container
COPY . .
# Run Gradle to build the application
RUN gradle build --no-daemon -x test
# Use a smaller base image for the final run
FROM openjdk:17-jdk-slim
# Set the working directory inside the container
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/build/libs/smart-flashcards-api-0.0.1.jar /app/build/libs/smart-flashcards-api-0.0.1.jar
# Set the entrypoint command to run the Spring Boot application
ENTRYPOINT ["java", "-jar", "/app/build/libs/smart-flashcards-api-0.0.1.jar"]