-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
34 lines (25 loc) · 896 Bytes
/
Dockerfile
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
# Build stage
FROM eclipse-temurin:22-alpine AS builder
ARG JAR_FILE=naikan-server/target/naikan-server.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract
# Runtime stage
FROM eclipse-temurin:22-alpine
ARG USER=naikan
RUN set -eux; \
apk update; \
apk add --no-cache fontconfig ttf-dejavu tzdata; \
rm -rf /var/cache/apk/*; \
cp /usr/share/zoneinfo/UTC /etc/localtime; \
echo "UTC" > /etc/timezone; \
adduser -D -s /bin/sh $USER
WORKDIR /home/$USER
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
RUN chown -R $USER:$USER /home/$USER
USER $USER
VOLUME /tmp
EXPOSE 8080
ENTRYPOINT exec java $JAVA_OPTS $JAVA_TOOL_OPTIONS -Djava.security.egd=file:/dev/./urandom org.springframework.boot.loader.launch.JarLauncher