Fix Dockerfile
All checks were successful
Build Prowlarr Container / build (push) Successful in 6m20s
All checks were successful
Build Prowlarr Container / build (push) Successful in 6m20s
This commit is contained in:
55
Dockerfile
55
Dockerfile
@@ -1,83 +1,60 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
#===========================
|
# Build Prowlarr from source with patches applied
|
||||||
# Stage 1: Build Prowlarr from source
|
|
||||||
#===========================
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
||||||
|
|
||||||
# Install build dependencies
|
RUN apk add --no-cache bash git curl icu-libs nodejs npm yarn
|
||||||
RUN apk add --no-cache \
|
|
||||||
bash \
|
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
icu-libs \
|
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
yarn
|
|
||||||
|
|
||||||
# Arguments for upstream source
|
|
||||||
ARG PROWLARR_BRANCH="develop"
|
ARG PROWLARR_BRANCH="develop"
|
||||||
ARG PROWLARR_REPO="https://github.com/Prowlarr/Prowlarr.git"
|
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
RUN git clone --depth 1 --branch "${PROWLARR_BRANCH}" https://github.com/Prowlarr/Prowlarr.git .
|
||||||
|
|
||||||
# Clone upstream Prowlarr
|
|
||||||
RUN git clone --depth 1 --branch "${PROWLARR_BRANCH}" "${PROWLARR_REPO}" .
|
|
||||||
|
|
||||||
# Copy and apply patches
|
|
||||||
COPY patches/ /tmp/patches/
|
COPY patches/ /tmp/patches/
|
||||||
RUN git config user.email "build@local" && \
|
RUN git config user.email "build@local" && \
|
||||||
git config user.name "Build" && \
|
git config user.name "Build" && \
|
||||||
git am /tmp/patches/*.patch
|
git am /tmp/patches/*.patch
|
||||||
|
|
||||||
# Install frontend dependencies and build
|
RUN bash build.sh --backend -r linux-musl-x64 -f net8.0
|
||||||
RUN yarn install --frozen-lockfile --network-timeout 120000
|
RUN yarn install --frozen-lockfile --network-timeout 120000
|
||||||
RUN yarn run build --env production
|
RUN yarn run build --env production
|
||||||
|
|
||||||
# Build backend for linux-musl-x64 (Alpine)
|
|
||||||
RUN bash build.sh --backend -r linux-musl-x64 -f net8.0
|
|
||||||
|
|
||||||
# Package
|
|
||||||
RUN bash build.sh --packages -r linux-musl-x64 -f net8.0
|
RUN bash build.sh --packages -r linux-musl-x64 -f net8.0
|
||||||
|
|
||||||
#===========================
|
|
||||||
# Stage 2: Runtime
|
|
||||||
#===========================
|
|
||||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.23
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.23
|
||||||
|
|
||||||
# set version label
|
# set version label
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG PROWLARR_BRANCH="develop"
|
ARG PROWLARR_RELEASE
|
||||||
LABEL build_version="Custom build version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
LABEL maintainer="romain"
|
LABEL maintainer="Roxedus,thespad"
|
||||||
|
|
||||||
# environment settings
|
# environment settings
|
||||||
|
ARG PROWLARR_BRANCH="master"
|
||||||
ENV XDG_CONFIG_HOME="/config/xdg" \
|
ENV XDG_CONFIG_HOME="/config/xdg" \
|
||||||
COMPlus_EnableDiagnostics=0 \
|
COMPlus_EnableDiagnostics=0 \
|
||||||
TMPDIR=/run/prowlarr-temp
|
TMPDIR=/run/prowlarr-temp
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** install runtime packages ****" && \
|
echo "**** install packages ****" && \
|
||||||
apk add -U --upgrade --no-cache \
|
apk add -U --upgrade --no-cache \
|
||||||
icu-libs \
|
icu-libs \
|
||||||
sqlite-libs \
|
sqlite-libs \
|
||||||
xmlstarlet
|
xmlstarlet && \
|
||||||
|
echo "**** install prowlarr ****" && \
|
||||||
|
mkdir -p /app/prowlarr/bin
|
||||||
|
|
||||||
# Copy compiled Prowlarr from build stage
|
|
||||||
RUN mkdir -p /app/prowlarr/bin
|
|
||||||
COPY --from=build /src/_artifacts/linux-musl-x64/net8.0/Prowlarr/ /app/prowlarr/bin/
|
COPY --from=build /src/_artifacts/linux-musl-x64/net8.0/Prowlarr/ /app/prowlarr/bin/
|
||||||
|
|
||||||
# Write package info
|
RUN \
|
||||||
RUN echo -e "UpdateMethod=docker\nBranch=${PROWLARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=custom-build" > /app/prowlarr/package_info && \
|
echo -e "UpdateMethod=docker\nBranch=${PROWLARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://www.linuxserver.io/)" > /app/prowlarr/package_info && \
|
||||||
printf "Custom build version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
|
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
|
||||||
echo "**** cleanup ****" && \
|
echo "**** cleanup ****" && \
|
||||||
rm -rf \
|
rm -rf \
|
||||||
/app/prowlarr/bin/Prowlarr.Update \
|
/app/prowlarr/bin/Prowlarr.Update \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
/var/tmp/*
|
/var/tmp/*
|
||||||
|
|
||||||
# copy local files (s6 services)
|
# copy local files
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
|
|
||||||
# ports and volumes
|
# ports and volumes
|
||||||
|
|||||||
Reference in New Issue
Block a user