ARG JAVA_VERSION=21

FROM maven:3.9.11-eclipse-temurin-${JAVA_VERSION}

# Install Node.js v20.x
RUN apt-get update && \
    apt-get install -y curl && \
    curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /test
COPY . .

# Install google-java-format tool
RUN npm install -g google-java-format

# Install client dependencies
RUN cd jams-react-client && npm install
