Skip to content

Commit

Permalink
Improve docker image size
Browse files Browse the repository at this point in the history
  • Loading branch information
l7ssha committed Nov 29, 2024
1 parent cae48a9 commit 1a0b91b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ RUN dart pub get
COPY . /app
RUN dart pub get --offline

FROM build as dev
FROM build AS dev

CMD [ "dart", "run", "bin/running_on_dart.dart" ]

FROM build as prod
FROM build AS build_prod

RUN dart run nyxx_commands:compile bin/running_on_dart.dart -o bot

CMD [ "./bot.exe" ]
FROM scratch AS prod

WORKDIR /app

COPY --from=build_prod /runtime /
COPY --from=build_prod /app/** /app

CMD [ "./bot.exe" ]

0 comments on commit 1a0b91b

Please sign in to comment.