FROM dart:stable AS build

WORKDIR /app
COPY pubspec.* .
RUN dart pub get

COPY . .
RUN dart pub get --offline
RUN dart compile exe bin/uncloseai.dart -o bin/uncloseai

FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/bin/uncloseai /app/bin/

CMD ["/app/bin/uncloseai"]
