autocomit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Multi-stage build for Spring Boot backend
|
||||
FROM maven:3.9-eclipse-temurin-17-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy pom.xml and download dependencies (cached layer)
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline -B
|
||||
|
||||
# Copy source code and build
|
||||
COPY src ./src
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Runtime stage
|
||||
FROM eclipse-temurin:17-jre-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy JAR from build stage
|
||||
COPY --from=build /app/target/*.jar app.jar
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8080
|
||||
|
||||
# Run the application
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
Reference in New Issue
Block a user