-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for developer API server
- Loading branch information
1 parent
40a0d1f
commit 17eb4fe
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2024 Logan Magee | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
FROM eclipse-temurin:17-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:17-jdk AS builder | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG BUILD_SYSTEM=linux-x86_64 | ||
ARG PROTOBUF_VERSION=28.2 | ||
|
||
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:17-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"] |