-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 673 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 673 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
# Builder stage
FROM eclipse-temurin:25-jdk-alpine AS builder
WORKDIR /app
COPY gradlew ./
COPY gradle/ ./gradle/
COPY *.gradle ./
RUN chmod +x gradlew && \
./gradlew dependencies --no-daemon
COPY src/ ./src/
RUN ./gradlew assemble --no-daemon
# Runner stage
FROM eclipse-temurin:25-jre-alpine AS runner
RUN addgroup -g 1001 appgroup && \
adduser -S -D -u 1001 -G appgroup appuser && \
mkdir -p /app && \
chown appuser:appgroup /app
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /app/build/app/ ./
ENV PORT=8080
EXPOSE $PORT
USER appuser
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75.0", "-cp", "*", "com.dencode.web.server.ServerMain"]