Files
XpenselyServer/dockerfile

24 lines
400 B
Plaintext

# Stage 1: Build the JAR
FROM eclipse-temurin:17-jdk AS build
WORKDIR /app
# Copy Maven files and source code
COPY pom.xml .
COPY src ./src
# Build the Spring Boot app
RUN ./mvnw clean package -DskipTests
# Stage 2: Runtime
FROM eclipse-temurin:17-jdk
WORKDIR /app
# Copy built JAR from build stage
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","app.jar"]