diff --git a/Dockerfile.piped b/Dockerfile.piped index afd6775..d05ea90 100644 --- a/Dockerfile.piped +++ b/Dockerfile.piped @@ -1,10 +1,30 @@ FROM eclipse-temurin:21-jdk-noble AS build +RUN apt update && apt install -y git curl gcc && rm -rf /var/lib/apt/lists/* +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal +ENV PATH="/root/.cargo/bin:$PATH" + +WORKDIR /r4j + +RUN git clone --single-branch --depth 1 https://github.com/TeamPiped/reqwest4j.git ./ + +RUN sed -E -i \ + -e 's/command\.set\("cross"\)/command.set("cargo")/' \ + -e '/targets \+= target/d' \ + -e '/command\.set\("cargo"\)/a targets += defaultTarget()' \ + reqwest-jni/build.gradle.kts + +RUN ./gradlew shadowJar +RUN find build/libs -name 'reqwest4j-*.jar' -exec mv {} /r4j/lib.jar \; + WORKDIR /app -RUN apt update && apt install -y git && rm -rf /var/lib/apt/lists/* RUN git clone --single-branch --depth 1 https://github.com/TeamPiped/Piped-Backend.git ./ +RUN sed -i \ + -e "s#implementation 'rocks.kavin:reqwest4j:.*'#implementation files('/r4j/lib.jar')#" \ + build.gradle + RUN ./gradlew shadowJar RUN sh -c 'echo "$(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD)" >VERSION' diff --git a/compose.piped.yml b/compose.piped.yml index b83dd75..d0f3db8 100644 --- a/compose.piped.yml +++ b/compose.piped.yml @@ -1,4 +1,10 @@ services: + # piped-build-dbg: + # image: piped-build-dbg + # build: + # context: . + # dockerfile: Dockerfile.piped + # target: build piped: image: git.dc09.ru/darkcat09/piped build: