-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgraalvm-Dockerfile
More file actions
50 lines (40 loc) · 1.71 KB
/
Copy pathgraalvm-Dockerfile
File metadata and controls
50 lines (40 loc) · 1.71 KB
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
FROM ghcr.io/graalvm/native-image:ol9-java17-22.3.2 AS build
# Install tar and gzip to extract the Maven binaries
RUN microdnf update \
&& microdnf install --nodocs \
tar \
gzip \
&& microdnf clean all \
&& rm -rf /var/cache/yum
# Install Maven
# Source:
# 1) https://github.com/carlossg/docker-maven/blob/925e49a1d0986070208e3c06a11c41f8f2cada82/openjdk-17/Dockerfile
# 2) https://maven.apache.org/download.cgi
ARG USER_HOME_DIR="/root"
ARG SHA=1ea149f4e48bc7b34d554aef86f948eca7df4e7874e30caf449f3708e4f8487c71a5e5c072a05f17c60406176ebeeaf56b5f895090c7346f8238e2da06cf6ecd
ARG MAVEN_DOWNLOAD_URL=https://dlcdn.apache.org/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.tar.gz
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_DOWNLOAD_URL} \
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
WORKDIR /app
COPY pom.xml .
COPY src ./src
COPY frontend ./frontend
COPY package-lock.json .
COPY tsconfig.json .
RUN mvn package -Pproduction -Pnative native:compile -Dvaadin.force.production.build=true
FROM ghcr.io/graalvm/native-image:ol9-java17-22.3.2
# FROM openjdk:17-alpine
WORKDIR /app
RUN mkdir -p config
RUN mkdir -p frontend
COPY --from=build /app/target/*.jar .
COPY --from=build /app/frontend/* ./frontend/
COPY config/application.yml ./config/
COPY config/verticles.yml ./config/
ENTRYPOINT ["java", "--enable-preview" ,"-jar","yaz-condominium-manager-1.0.0.jar"]