-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 855 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
35
36
37
38
39
40
41
FROM eclipse-temurin:19 AS base
SHELL ["/usr/bin/bash", "-euo", "pipefail", "-c"]
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends && \
apt-get install -y --no-install-recommends \
ca-certificates
FROM base AS builder
RUN apt-get install -y --no-install-recommends \
curl unzip zip
WORKDIR /build
# Install gradle from wrapper
COPY gradle/ gradle/
COPY gradle* ./
RUN ./gradlew --no-daemon
# Install dependencies
RUN mkdir -p ./app
COPY settings.gradle.kts ./
COPY app/build.gradle.kts ./app/
RUN ./gradlew --no-daemon -i --refresh-dependencies
COPY . .
RUN ./gradlew --no-daemon -i buildFatJar
FROM base AS final
WORKDIR /app
COPY --from=builder /build/app/build/libs/app-all.jar ./
# Set user to nobody
USER 65534:65534
EXPOSE 8080
ENTRYPOINT ["/opt/java/openjdk/bin/java"]
CMD ["-jar", "/app/app-all.jar"]