Add files via upload

update for build
This commit is contained in:
tautaus 2024-07-27 12:42:24 -07:00 committed by GitHub
parent a3c15027d5
commit d5c6f31b5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,24 +1,26 @@
# Use an official OpenJDK runtime as a parent image # First stage: Build the application using Maven
FROM openjdk FROM maven:3.8.1-openjdk-17 AS build
WORKDIR /app
# Set the working directory inside the container
WORKDIR /app # Copy the Maven wrapper and the pom.xml file
COPY .mvn/ .mvn
# Copy the Maven wrapper and the pom.xml file COPY mvnw pom.xml ./
COPY .mvn/ .mvn
COPY mvnw pom.xml ./ # Copy the project source code
COPY src ./src
# Copy the project source code
COPY src ./src # Package the application
RUN ./mvnw package
# Package the application
RUN ./mvnw clean package -DskipTests # Second stage: Use an official OpenJDK runtime as a parent image
FROM openjdk
# Copy the JAR file to the app directory WORKDIR /app
COPY target/*.jar app.jar
# Copy the JAR file from the build stage
# Run the jar file COPY --from=build /app/target/*.jar app.jar
CMD ["java", "-jar", "app.jar"]
# Run the jar file
# Expose the port the app runs on CMD ["java", "-jar", "app.jar"]
EXPOSE 8080
# Expose the port the app runs on
EXPOSE 8080