Skip to content

Instantly share code, notes, and snippets.

@dipendra-sharma
Forked from anoochit/Dockerfile
Created April 25, 2021 08:19
Show Gist options
  • Save dipendra-sharma/6c0348f262b0040d6f81757cb4e28c83 to your computer and use it in GitHub Desktop.
Save dipendra-sharma/6c0348f262b0040d6f81757cb4e28c83 to your computer and use it in GitHub Desktop.
Dockerfile to build dart container in small image **ONLY** x86_64 arch
FROM google/dart AS dart-runtime
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
RUN pub get --offline
RUN dart2native /app/bin/server.dart -o /app/server
FROM frolvlad/alpine-glibc
COPY --from=dart-runtime /app/server /server
CMD []
ENTRYPOINT ["/server"]
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment