-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.jvm
75 lines (57 loc) · 2.25 KB
/
Dockerfile.jvm
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM azul/zulu-openjdk-alpine:17 AS builder
RUN apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ --no-cache \
nodejs \
npm \
&& mkdir workspace \
&& chown 1001 workspace \
&& chmod "g+rwX" workspace \
&& chown 1001:root workspace
WORKDIR /workspace
COPY pom.xml .
COPY mvnw .
COPY .mvn .mvn
RUN ./mvnw dependency:copy-dependencies
COPY src src
RUN ./mvnw package
FROM alpine:3.14
ENV DEPLOYMENTS=/deployments
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
ENV PATH=$PATH:/home/node/.npm-global/lib
ENV NODE_ENV=production
ARG RUN_JAVA_VERSION=1.3.8
RUN wget -P /etc/apk/keys/ \
https://cdn.azul.com/public_keys/alpine-signing@azul.com-5d5dc44c.rsa.pub
RUN echo "https://repos.azul.com/zulu/alpine" | tee -a /etc/apk/repositories
RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add -U --no-cache \
curl \
nodejs \
npm \
zulu17-jdk \
&& mkdir /deployments \
&& chown node $DEPLOYMENTS \
&& chmod "g+rwX" $DEPLOYMENTS \
&& chown node:root $DEPLOYMENTS \
&& curl -sSL https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o $DEPLOYMENTS/run-java.sh \
&& chown node $DEPLOYMENTS/run-java.sh \
&& chmod 540 $DEPLOYMENTS/run-java.sh
USER node
WORKDIR /home/node/
RUN curl -sSL https://raw.githubusercontent.com/liferay/liferay-blade-cli/master/cli/installers/local | sh
ENV PATH "$PATH:/home/node/jpm/bin"
RUN blade update && \
blade version
RUN npm i -g yarn \
&& yarn global add yo@3.1.0
RUN yarn global add generator-old-liferay-theme@npm:generator-liferay-theme@^8.0.0 \
&& yarn global add generator-liferay-theme@10.1.0 \
&& yarn global add generator-liferay-js
COPY --from=builder "/workspace/target/quarkus-app/lib/" "$DEPLOYMENTS/lib/"
COPY --from=builder "/workspace/target/quarkus-app/*.jar" "$DEPLOYMENTS/"
COPY --from=builder "/workspace/target/quarkus-app/app/" "$DEPLOYMENTS/app/"
COPY --from=builder "/workspace/target/quarkus-app/quarkus/" "$DEPLOYMENTS/quarkus/"
EXPOSE 8080
ENTRYPOINT [ "/deployments/run-java.sh" ]