# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Maven for building the application
FROM mirror.gcr.io/maven:3.9.9-eclipse-temurin-21 AS builder

# Set the working directory
WORKDIR /app

# Copy the pom.xml and source code
COPY pom.xml ./
COPY common ./common
COPY stdio ./stdio
COPY sse ./sse

# Package the application
RUN mvn clean install

# Use a JDK image for the runtime
FROM mirror.gcr.io/openjdk:21-jdk-slim

# Set the working directory
WORKDIR /app

# Copy the built jar file from the builder stage
COPY --from=builder /app/stdio/target/wildfly-mcp-server-stdio-runner.jar ./wildfly-mcp-server.jar

# Run the application
ENTRYPOINT ["java", "-jar", "wildfly-mcp-server.jar"]