Created
August 1, 2020 02:10
-
-
Save Grohden/7f2faf60f0c5dfb1826cbc19cb0426fe to your computer and use it in GitHub Desktop.
suffering, but now with dockerfile. Docker file containing barebones flutter env and builds for my kotlin app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM vergissberlin/debian-development as frontend-build | |
RUN mkdir -p /home/root/frontend | |
WORKDIR /home/root/frontend | |
# Based on cirrusci/flutter:beta but without android sdk. | |
ENV FLUTTER_ROOT="/opt/flutter" | |
ENV PATH ${PATH}:${FLUTTER_ROOT}/bin:${FLUTTER_ROOT}/bin/cache/dart-sdk/bin | |
RUN git clone --branch "beta" --depth 1 https://github.com/flutter/flutter.git ${FLUTTER_ROOT} | |
# Copy current frontend | |
COPY --chown=root:root ./frontend . | |
# Actually build flutter | |
RUN flutter config --enable-web && \ | |
flutter packages get && \ | |
flutter packages pub run build_runner build --delete-conflicting-outputs && \ | |
flutter build web | |
# Backend build | |
FROM openjdk:8-jdk-alpine as backend-build | |
RUN mkdir -p /home/root/backend | |
WORKDIR /home/root/backend | |
COPY --chown=root:root ./backend . | |
COPY --from=frontend-build /home/root/frontend/build/web ./resources/web | |
# Actually build backend | |
RUN ./gradlew :shadowJar | |
# Backend serve | |
FROM openjdk:8-jdk-alpine | |
RUN adduser -D -g '' server | |
RUN mkdir /app | |
RUN chown -R server /app | |
USER server | |
COPY --from=backend-build /home/root/backend/build/libs/repotagger-all.jar /app/repotagger-all.jar | |
WORKDIR /app | |
CMD ["java", "-server", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:InitialRAMFraction=2", "-XX:MinRAMFraction=2", "-XX:MaxRAMFraction=2", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-jar", "repotagger-all.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment