1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-25 05:41:41 +00:00

code sharing sample: flat package directory (#1486)

This commit is contained in:
Kevin Moore
2022-10-20 09:00:41 -07:00
committed by GitHub
parent c21fcd6573
commit 6caaa0a3c9
19 changed files with 32 additions and 19 deletions

26
code_sharing/Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# Use latest stable channel SDK.
FROM dart:stable AS build
# Copy shared code.
WORKDIR /shared
COPY /shared/. .
# Copy server code.
WORKDIR /server
COPY /server/. .
# 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/ /
COPY --from=build /server/bin/server /app/bin/
# Start server.
EXPOSE 8080
CMD ["/app/bin/server"]