Skip to content

Instantly share code, notes, and snippets.

@pmundt
Created October 4, 2019 15:49
Show Gist options
  • Save pmundt/d995bfc50503d809d8c7ed6a90a085d8 to your computer and use it in GitHub Desktop.
Save pmundt/d995bfc50503d809d8c7ed6a90a085d8 to your computer and use it in GitHub Desktop.
Multi-Stage Dockerfile for native compilation of server-side app using alpine-glibc base
FROM google/dart:2.6-dev AS dart-runtime
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
ADD lib /app/lib/
RUN pub get --offline
RUN dart2native /app/bin/server.dart -o /app/server
FROM frolvlad/alpine-glibc:alpine-3.9_glibc-2.29
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