-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.native
34 lines (23 loc) · 922 Bytes
/
Dockerfile.native
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
FROM ghcr.io/graalvm/graalvm-community:21.0.2 AS build
RUN useradd -ms /bin/sh builder
USER builder
WORKDIR /home/builder/app
COPY --chown=builder:builder gradlew build.gradle.kts settings.gradle.kts gradle.properties ./
COPY --chown=builder:builder src ./src
COPY --chown=builder:builder gradle ./gradle
RUN sed -i 's/\r$//' gradlew
RUN chmod +x ./gradlew
RUN ./gradlew nativeOptimizedCompile
FROM bellsoft/liberica-openjdk-alpine-musl
RUN apk update && \
apk add --no-cache libc6-compat
RUN addgroup -S appgroup -g 1000 && \
adduser -S -G appgroup -u 1000 -h /app runner
USER runner
WORKDIR /app
COPY --from=build /home/builder/app/build/native/nativeOptimizedCompile/fenrir-s-v1.0.1 ./
COPY --chown=runner:appgroup .env /app/.env
EXPOSE 6724
ENTRYPOINT sh -c "/app/fenrir-s-v1.0.1 -Xms256m -Xmx2g; \
while [ ! -f logs/activity.log ]; do sleep 3; done; \
cd logs; tail -n 100 -f activity.log"