# Use OpenJDK 17 as the base image FROM openjdk:17-jdk-slim # Set the working directory in the container WORKDIR /app # Copy the JAR file into the container # Replace 'your-app.jar' with your actual JAR file name COPY target/*.jar app.jar # Expose port 8090 EXPOSE 8090 # Create a non-root user for security RUN addgroup --system spring && adduser --system spring --ingroup spring USER spring:spring # Run the application ENTRYPOINT ["java", "-jar", "app.jar"]