-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
45 lines (35 loc) · 1.33 KB
/
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
42
43
44
45
# Copyright 2024 Logan Magee
#
# SPDX-License-Identifier: AGPL-3.0-only
FROM eclipse-temurin:21-jdk AS cache
ENV GRADLE_USER_HOME=/cache
COPY apksparser/build.gradle.kts /app/apksparser/
COPY console/build.gradle.kts /app/console/
COPY gradle/ /app/gradle/
COPY build.gradle.kts gradle.properties gradlew settings.gradle.kts /app/
WORKDIR /app
RUN ./gradlew clean build --no-daemon
FROM eclipse-temurin:21-jdk AS builder
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_SYSTEM=linux-x86_64
ARG PROTOBUF_VERSION=28.3
RUN apt-get update \
&& apt-get install -y --no-install-recommends unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -Lo protoc.zip \
https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-$BUILD_SYSTEM.zip \
&& unzip -o protoc.zip -d /usr/local bin/protoc \
&& unzip -o protoc.zip -d /usr/local 'include/*' \
&& rm -f protoc.zip
WORKDIR /build
COPY --from=cache /cache /root/.gradle
COPY . /build
RUN ./gradlew clean buildFatJar --no-daemon
FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=builder /build/console/build/libs/console-all.jar parcelo-console.jar
RUN groupadd -r parcelo-console && useradd --no-log-init -r -g parcelo-console parcelo-console
USER parcelo-console
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "parcelo-console.jar"]