-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 699 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Stage 1: Build the application
FROM gradle:jdk17-jammy AS builder
# Set working directory
WORKDIR /app
# Copy Gradle files for dependency resolution
COPY build.gradle .
COPY settings.gradle .
#COPY gradle.properties .
# Copy the entire project
COPY . .
# Build the application
RUN gradle clean build --no-daemon
# Stage 2: Run the application
FROM openjdk:17-slim
# Set the working directory
WORKDIR /app
# Copy the JAR file from the builder stage to the runtime stage
COPY --from=builder /app/search-app/build/libs/search-app.jar search-app.jar
#COPY --from=builder . .
# Expose the port the app runs on
EXPOSE 8080
# Command to run the application
CMD ["java", "-jar", "search-app.jar"]