Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkfella authored Nov 16, 2024
1 parent 62ab7e1 commit 837e2cd
Showing 1 changed file with 54 additions and 63 deletions.
117 changes: 54 additions & 63 deletions apps/bazarr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
FROM ghcr.io/linuxserver/unrar:latest AS unrar
FROM docker.io/library/python:3.12-alpine

FROM ghcr.io/linuxserver/baseimage-alpine:3.20

# set version label
ARG BUILD_DATE
ARG TARGETPLATFORM
ARG VERSION
ARG BAZARR_VERSION
LABEL build_version="DarkfellaNET version:- 1.4.5 Build-date:- 2024"
LABEL maintainer="Darkfella"
LABEL org.opencontainers.image.source="https://github.com/morpheus65535/bazarr"
# hard set UTC in case the user does not define it

ENV TZ="Etc/UTC"
ENV BAZARR__PORT=6767
ENV UMASK="0002"
ARG CHANNEL

ENV \
PYTHONDONTWRITEBYTECODE=1 \
Expand All @@ -24,60 +13,62 @@ ENV \
PIP_BREAK_SYSTEM_PACKAGES=1 \
CRYPTOGRAPHY_DONT_BUILD_RUST=1

RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
cargo \
libffi-dev \
libpq-dev \
libxml2-dev \
libxslt-dev \
python3-dev \
pipx && \
echo "**** install packages ****" && \
apk add --no-cache \
ffmpeg \
libxml2 \
libxslt \
mediainfo \
python3 && \
echo "**** install bazarr ****" && \
mkdir -p \
/app/bazarr/bin && \
curl -o \
/tmp/bazarr.zip -L \
"https://github.com/morpheus65535/bazarr/releases/download/v1.4.5/bazarr.zip" && \
unzip \
/tmp/bazarr.zip -d \
/app/bazarr/bin && \
rm -Rf /app/bazarr/bin/bin && \
echo "UpdateMethod=docker\nBranch=master\nPackageVersion=v1.4.5\nPackageAuthor=linuxserver.io" > /app/bazarr/package_info && \
curl -o \
/app/bazarr/bin/postgres-requirements.txt -L \
"https://raw.githubusercontent.com/morpheus65535/bazarr/v1.4.5/postgres-requirements.txt" && \
echo "**** Install requirements ****" && \
pipx install --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ \
--requirement /app/bazarr/bin/requirements.txt \
--requirement /app/bazarr/bin/postgres-requirements.txt && \
printf "Linuxserver.io version: v1.4.5\nBuild-date: 2024" > /build_version && \
echo "**** clean up ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
$HOME/.cache \
$HOME/.cargo \
/tmp/*
ENV UMASK="0002" \
TZ="Etc/UTC"

ENV BAZARR__PORT=6767

COPY ./apps/bazarr/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && chown nobody:nogroup /entrypoint.sh
USER root
WORKDIR /app

RUN chown nobody:nogroup /usr/bin/catatonit && chmod 755 /usr/bin/catatonit
#hadolint ignore=DL3018,DL3013
RUN \
apk add --no-cache \
bash \
ca-certificates \
catatonit \
coreutils \
curl \
ffmpeg \
jo \
jq \
libxml2 \
libxslt \
mediainfo \
nano \
trurl \
tzdata \
unzip \
libpq \
&& \
apk add --no-cache --virtual .build-deps \
build-base \
cargo \
libffi-dev \
libpq-dev \
libxml2-dev \
libxslt-dev \
&& \
curl -fsSL -o /tmp/app.zip "https://github.com/morpheus65535/bazarr/releases/download/v${VERSION}/bazarr.zip" \
&& unzip -q /tmp/app.zip -d /app/bin \
&& \
rm -rf /app/bin/bin \
&& \
printf "UpdateMethod=docker\nBranch=master\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${VERSION}" > /app/package_info \
&& pip install --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ \
--requirement /app/bin/requirements.txt \
--requirement /app/bin/postgres-requirements.txt \
&& chown -R root:root /app && chmod -R 755 /app \
&& apk del --purge .build-deps \
&& rm -rf /root/.cache /root/.cargo /tmp/*

COPY --from=unrar /usr/bin/unrar-alpine /usr/bin/unrar
COPY ./apps/bazarr/entrypoint.sh /entrypoint.sh
COPY --from=ghcr.io/linuxserver/unrar:latest /usr/bin/unrar-alpine /usr/bin/unrar
RUN chmod 555 /usr/local/bin && chmod 555 /entrypoint.sh

USER nobody:nogroup
VOLUME /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"]

LABEL org.opencontainers.image.source="https://github.com/morpheus65535/bazarr"

0 comments on commit 837e2cd

Please sign in to comment.