-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 807 Bytes
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 807 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
FROM amazoncorretto:25-al2023-jdk@sha256:3371b8e140b9d38a267c8ee129d154049a78cd8af79fc68b7538d468466fcdd5
# Create a user
RUN yum update -y && \
yum install -y shadow-utils && \
yum clean all && \
rm -rf /var/cache/dnf
RUN groupadd -r appuser && \
useradd -m -r -g appuser appuser
USER appuser
WORKDIR /app/
RUN chown -R appuser:appuser /app
# Install Gradle
COPY --chown=appuser:appuser ./gradle/ /app/gradle/
COPY --chown=appuser:appuser ./gradlew /app/
RUN ./gradlew --version --no-daemon
# Install dependencies
COPY --chown=appuser:appuser ./build.gradle ./settings.gradle /app/
RUN ./gradlew dependencies --no-daemon
# Build project
COPY --chown=appuser:appuser . /app/
RUN ./gradlew build shadowJar --no-daemon
# Disable building a JAR because we already built it.
ENV SHADOW=No