FROM maven:3.8.5-openjdk-17 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests

FROM eclipse-temurin:17-jre
WORKDIR /app
COPY --from=build /app/target/web-client-1.0-SNAPSHOT.jar app.jar
EXPOSE 8080
ENV GAME_SERVER_HOST=server
ENV GAME_SERVER_PORT=1870
CMD ["java", "-jar", "app.jar"]
