Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Nov 20, 2023
1 parent b1e686c commit b50d232
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pub_stats_collector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM dart:stable AS build

# Resolve app dependencies.
WORKDIR /app
COPY pubspec.* ./
# The docker build command must be run from the root of the repo
WORKDIR /app/pub_stats_collector
COPY pub_stats_core ../pub_stats_core
COPY pub_stats_collector .
RUN dart pub get

# Copy app source code and AOT compile it.
COPY . .
# Ensure packages are still up-to-date if anything has changed
RUN dart pub get --offline
RUN dart pub run build_runner build --delete-conflicting-outputs
RUN dart compile exe bin/pub_stats_collector.dart -o bin/server

# Build minimal serving image from AOT-compiled `/server` and required system
# libraries and configuration files stored in `/runtime/` from the build stage.
FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /app/bin/
COPY --from=build /app/pub_stats_collector/bin/server /app/bin/

# Start server.
EXPOSE 8080
Expand Down

0 comments on commit b50d232

Please sign in to comment.