forked from skku-comit/comit-website-spring-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 675 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 675 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
# Use the official OpenJDK image as a base image
FROM openjdk:17-slim
# Set the working directory inside the container
WORKDIR /app
# Copy the gradle configuration files first
COPY build.gradle settings.gradle /app/
COPY gradlew /app/
COPY gradle /app/gradle
# Make the gradlew executable
RUN chmod +x ./gradlew
# Download dependencies only (using a placeholder main class)
RUN ./gradlew dependencies --no-daemon
# Now copy the source code
COPY src /app/src
# Build the application
RUN ./gradlew build --no-daemon
# Expose the port the app runs on
EXPOSE 8080
# Run the Spring Boot application
ENTRYPOINT ["java", "-jar", "build/libs/comit-server-0.0.1-SNAPSHOT.jar"]