blob: 6de13f85f03c19da8f70777ec17ad4516e6c4b1f [file] [log] [blame]
FROM google/dart:2.12.2
# We install unzip and remove the apt-index again to keep the
# docker image diff small.
RUN apt-get update && \
apt-get install -y unzip && \
rm -rf /var/lib/apt/lists/*
RUN groupadd --system dart && \
useradd --no-log-init --system --home /home/dart --create-home -g dart dart
RUN chown dart:dart /app
# Switch to a new, non-root user to use the flutter tool.
# The Flutter tool won't perform its actions when run as root.
USER dart
COPY --chown=dart:dart tool/ /dart_runtime/
RUN chmod a+x /dart_runtime/
COPY --chown=dart:dart pubspec.* /app/
RUN pub get
COPY --chown=dart:dart . /app
RUN pub get --offline
ENV PATH="/home/dart/.pub-cache/bin:${PATH}"
# Set the Flutter SDK up for web compilation.
RUN dart pub run grinder setup-flutter-sdk
# Build the dill file
RUN dart pub run grinder build-storage-artifacts validate-storage-artifacts
# Clear out any arguments the base images might have set and ensure we start
# the Dart app using custom script enabling debug modes.
CMD []
ENTRYPOINT ["/dart_runtime/", "--port", "${PORT}", \
"--redis-url", "redis://"]