# Use an official OpenJDK runtime as the base image
FROM openjdk:21-jdk-slim

# Set working directory inside the container
WORKDIR /app

# Copy the JAR file into the container
COPY agent-service-0.21-SNAPSHOT.jar /app/agent-service.jar

# Copy the conf directory (optional, if you want to use the external properties file)
COPY conf /app/conf

# Command to run the JAR with config location
CMD ["java", "-Dspring.config.location=file:/app/conf/application.properties", "-jar", "/app/agent-service.jar"]