setup prod deploy with db

This commit is contained in:
2025-10-23 19:26:21 +02:00
parent 3d20e876c3
commit 4a2838c208
3 changed files with 55 additions and 2 deletions

View File

@@ -1 +1,29 @@
# TODO
# Stage 1: Build stage
FROM maven:3.9-eclipse-temurin-21 AS build
# Set the working directory inside the container
WORKDIR /app
# Copy the pom.xml and dependencies (helps in caching dependencies)
COPY pom.xml .
# Download dependencies (this will cache dependencies in the Docker layer)
RUN mvn dependency:go-offline
# Copy the rest of the application source code
COPY src ./src
# Build the Spring Boot app
RUN mvn clean package
# Stage 2: Run stage
FROM eclipse-temurin:21-jdk AS runtime
# Copy the built JAR file from the build stage
COPY --from=build /app/target/*.jar /app/app.jar
# Expose the default Spring Boot port
EXPOSE 8080
# Command to run the Spring Boot application
ENTRYPOINT ["java", "-jar", "/app/app.jar"]