-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (25 loc) · 975 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
FROM maven:3.9.6-eclipse-temurin-21-alpine as builder
WORKDIR build
COPY pom.xml .
COPY src src
COPY app app
RUN mvn -B -DskipTests -Pproduction clean package
FROM eclipse-temurin:21-jre-alpine as packager
WORKDIR application
COPY --from=builder /build/target/*.jar application.jar
RUN java -Djarmode=layertools -jar application.jar extract
FROM eclipse-temurin:21-jre-alpine as runtime
LABEL maintainer="Vitalijus Dobrovolskis [email protected]"
VOLUME /tmp
RUN addgroup --system spring && adduser --system spring --ingroup spring
RUN mkdir -p /application/work/index && chown -R spring:spring /application/work
VOLUME /application/work
USER spring:spring
WORKDIR /application
COPY setup_env.sh .
COPY --from=packager application/dependencies/ ./
COPY --from=packager application/spring-boot-loader/ ./
COPY --from=packager application/snapshot-dependencies/ ./
COPY --from=packager application/application/ ./
EXPOSE 8080
ENTRYPOINT ["/bin/sh", "setup_env.sh"]