-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 854 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (27 loc) · 854 Bytes
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
# -----------------------------------------
# Stage 1: build
# -----------------------------------------
FROM eclipse-temurin:21-jdk as builder
RUN apt-get update && apt-get install -y \
git \
make \
gcc \
g++ \
maven \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY pom.xml .
COPY src ./src
COPY scripts ./scripts
RUN chmod +x scripts/setup-native.sh \
&& bash scripts/setup-native.sh \
&& mvn package -DskiptTests -q
# -----------------------------------------
# Stage 2: runtime
# -----------------------------------------
FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=builder /build/target/mathlib-api-0.1.jar app.jar
COPY --from=builder /build/src/main/resources/libmathlib.so lib/libmathlib.so
EXPOSE 8000
ENTRYPOINT ["java", "-Djava.library.apth=/app/lib", "-jar", "/app/app.jar"]