# Use a base image with Java 11
FROM openjdk:11-jdk-slim

# Set the working directory inside the container
WORKDIR /app

# Copy the JAR file built by Maven into the container
# The JAR file is expected to be in target/product-service-0.0.1-SNAPSHOT.jar
# after the Maven build.
ARG JAR_FILE=target/product-service-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar

# Expose the port the Spring Boot application runs on
EXPOSE 8081 # Using a different port for product-service

# Run the JAR file when the container starts
ENTRYPOINT ["java", "-jar", "app.jar"]
