-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 1.04 KB
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
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /app
COPY build/libs/*.jar application.jar
RUN java -Djarmode=tools -jar application.jar extract --layers --launcher
FROM eclipse-temurin:21-jre
LABEL maintainer="FFW Baudenbach <webmaster@ffw-baudenbach.de>"
EXPOSE 8080
# Set timezone
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin
RUN apt-get update && apt-get install --no-install-recommends -y tzdata && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Create and own directory
RUN mkdir /app && chown -R 1000:1000 /app
USER 1000
WORKDIR /app
# Copy application from builder stage
COPY --chown=1000:1000 --from=builder /app/application/dependencies/ ./
COPY --chown=1000:1000 --from=builder /app/application/spring-boot-loader/ ./
COPY --chown=1000:1000 --from=builder /app/application/snapshot-dependencies/ ./
COPY --chown=1000:1000 --from=builder /app/application/application/ ./
# Set entrypoint
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]