FROM hseeberger/scala-sbt:17.0.2_1.6.2_2.13.8 as build

WORKDIR /app
COPY . /app

RUN sbt clean assembly

FROM amazoncorretto:17-alpine

WORKDIR /app

COPY --from=build /app/web/dist/ web/dist/
COPY --from=build /app/target/scala-2.13/WeatherTool-assembly-0.1.1-SNAPSHOT.jar app.jar

VOLUME /app/data

CMD ["java", "-jar", "app.jar"]
