# Use latest stable channel SDK.
FROM dart:3.5.4 AS build
LABEL qmqz=admin@ipayl.com

# Resolve app dependencies.
WORKDIR /app
COPY pubspec.* ./
RUN dart pub get

ADD bin /app/bin
RUN dart compile exe bin/main.dart -o bin/server

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

CMD ["/app/bin/server"]