-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (32 loc) · 1.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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}
# Cached layer for flutter deps
RUN flutter config --enable-web
# Copy current frontend
COPY --chown=root:root ./frontend .
# Generate and build the frontend app
RUN 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 --no-daemon shadowJar
# Backend serve
FROM openjdk:8-jre-alpine
RUN adduser -D -g '' server && \
mkdir /app && \
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"]