# Start from a lightweight OpenJDK image
FROM eclipse-temurin:17-jre

# Set working directory inside the container
WORKDIR /app

# Copy the JAR file into the image
COPY convert-spring-boot.jar app.jar

# Copy IfcConvert
COPY IfcConvert /app/IfcConvert

# Ensure it's executable
RUN chmod +x /app/IfcConvert

# Install Python and pip
RUN apt-get update && \
    apt-get install -y python3 python3-pip && \
    rm -rf /var/lib/apt/lists/*

# Install ifcopenshell Python package
RUN pip3 install ifcopenshell

# Expose the port your Spring Boot app runs on
EXPOSE 80

# Run the Spring Boot app
ENTRYPOINT ["java", "-jar", "app.jar"]