mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
566 B
27 lines
566 B
2 years ago
|
# Use latest stable channel SDK.
|
||
|
FROM dart:stable AS build
|
||
|
|
||
2 years ago
|
# Copy shared code.
|
||
|
WORKDIR /shared
|
||
|
COPY /shared/. .
|
||
|
|
||
|
# Copy server code.
|
||
|
WORKDIR /server
|
||
|
COPY /server/. .
|
||
|
|
||
2 years ago
|
# Resolve app dependencies.
|
||
|
RUN dart pub get
|
||
|
|
||
|
# AOT compile app.
|
||
|
RUN dart compile exe bin/server.dart -o bin/server
|
||
|
|
||
|
# Build minimal serving image from AOT-compiled `/server`
|
||
|
# and the pre-built AOT-runtime in the `/runtime/` directory of the base image.
|
||
|
FROM scratch
|
||
|
COPY --from=build /runtime/ /
|
||
2 years ago
|
COPY --from=build /server/bin/server /app/bin/
|
||
2 years ago
|
|
||
|
# Start server.
|
||
|
EXPOSE 8080
|
||
|
CMD ["/app/bin/server"]
|