forked from RADAR-base/ManagementPortal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (48 loc) · 2.02 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Build stage
FROM --platform=$BUILDPLATFORM eclipse-temurin:17-jdk as builder
# Install NodeJS and Yarn
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash \
&& apt-get update && apt-get install -y \
nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn
## installing the node and java packages before adding the src directory
## will allow us to re-use these image layers when only the souce code changes
WORKDIR /code
ENV GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.project.prod=true -Dorg.gradle.vfs.watch=false"
COPY package.json yarn.lock .yarnrc.yml /code/
COPY .yarn /code/.yarn
RUN yarn install --network-timeout 1000000
COPY gradle gradle
COPY gradlew build.gradle gradle.properties settings.gradle /code/
COPY radar-auth/build.gradle radar-auth/
RUN ./gradlew downloadDependencies
# now we copy our application source code and build it
COPY angular.json proxy.conf.json tsconfig.app.json \
tsconfig.spec.json tsconfig.json tslint.json /code/
COPY webpack webpack
COPY radar-auth radar-auth
COPY src src
RUN ./gradlew -s bootWar
# Run stage
FROM eclipse-temurin:17-jre
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JHIPSTER_SLEEP=0 \
JAVA_OPTS=""
# Add the war and changelogs files from build stage
COPY --from=builder /code/build/libs/*.war /app.war
COPY --from=builder /code/src/main/docker/etc /mp-includes
EXPOSE 8080 5701/udp
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
sleep ${JHIPSTER_SLEEP} && \
java $JAVA_OPTS \
-Djava.security.egd=file:/dev/./urandom \
--add-modules java.se \
--add-exports java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens java.management/sun.management=ALL-UNNAMED \
--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \
-cp /mp-includes:/app.war \
org.springframework.boot.loader.WarLauncher