-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (22 loc) · 785 Bytes
/
Dockerfile
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
32
# Use a base image with Java and Maven installed
FROM maven:3.8.4-openjdk-17-slim AS build
# Set the working directory
WORKDIR /app
# Copy the pom.xml file to the working directory
COPY pom.xml .
# Download the project dependencies
RUN mvn dependency:go-offline -B
# Copy the source code to the working directory
COPY src ./src
# Build the application
RUN mvn package -DskipTests
# Use a lightweight base image with Java installed
FROM openjdk:17-jdk-slim
# Set the working directory
WORKDIR /app
# Copy the JAR file from the build stage to the current directory
COPY --from=build /app/target/*.jar ./fallofthegods-data.jar
# Expose the port on which the application will run
EXPOSE 8080
# Set the command to run the application
CMD ["java", "-jar", "fallofthegods-data.jar"]