-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.jvm
32 lines (21 loc) · 875 Bytes
/
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
FROM eclipse-temurin:21-jdk-jammy AS build
RUN useradd -ms /bin/bash builder
USER root
RUN apt-get update && apt-get install -y dos2unix
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 dos2unix gradlew
RUN ./gradlew build -x test
FROM bellsoft/liberica-openjdk-alpine:21
RUN apk update && apk add --no-cache bash && rm -rf /var/cache/apk/*
RUN addgroup -S appgroup -g 1000 && \
adduser -S runner -G appgroup -u 1000 -h /app
USER runner
WORKDIR /app
COPY --from=build /home/builder/app/build/libs/fenrir-s-1.0-all-optimized.jar ./
COPY --chown=runner:appgroup .env /app/.env
EXPOSE 6724
ENTRYPOINT ["java", "-Xms256m", "-Xmx3g", "-XX:+UseG1GC", "-jar", "fenrir-s-1.0-all-optimized.jar"]