YoutubeDL container efficiency upgrades (#381)
* try some youtubedl restructuring * Some more restructure * hadolint
This commit is contained in:
@@ -1,31 +1,40 @@
|
|||||||
# hadolint ignore=DL3007
|
# hadolint ignore=DL3007
|
||||||
FROM ghcr.io/truecharts/ubuntu:latest AS builder
|
FROM ghcr.io/truecharts/ubuntu:latest AS builder
|
||||||
|
|
||||||
ARG VERSION
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /extract/build
|
||||||
|
|
||||||
# hadolint ignore=DL3002
|
# hadolint ignore=DL3002
|
||||||
USER root
|
USER root
|
||||||
|
ARG VERSION
|
||||||
|
ENV VERSION=4.2
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016
|
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016
|
||||||
RUN \
|
RUN \
|
||||||
apt-get -qq update \
|
apt-get -qq update \
|
||||||
&& \
|
&& \
|
||||||
apt-get -qq install -y \
|
apt-get -qq install -y \
|
||||||
nodejs \
|
npm
|
||||||
unzip \
|
|
||||||
python \
|
# hadolint ignore=DL3016
|
||||||
npm \
|
RUN npm install -g @angular/cli
|
||||||
&& \
|
|
||||||
export URL="https://github.com/Tzahi12345/YoutubeDL-Material/releases/download/v${VERSION}/youtubedl-material-v${VERSION}.zip" \
|
RUN \
|
||||||
&& curl -fsSL -o /tmp/youtubedl.zip "${URL}" \
|
export URL="https://github.com/Tzahi12345/YoutubeDL-Material/archive/refs/tags/v${VERSION}.tar.gz" \
|
||||||
&& unzip /tmp/youtubedl.zip -d /tmp \
|
&& curl -fsSL -o /tmp/youtubedl.tgz "${URL}" \
|
||||||
&& cp -Rf /tmp/youtubedl-material/* /app \
|
&& tar ixzf /tmp/youtubedl.tgz -C /extract --strip-components=1 \
|
||||||
&& printf "UpdateMethod=docker\nPackageVersion=%s\nPackageAuthor=[TrueCharts Project](https://truecharts.org)" "${VERSION}" > /app/package_info \
|
&& cp /extract/package.json /extract/package-lock.json /extract/build
|
||||||
&& echo "==running NPM install==" \
|
|
||||||
&& npm install
|
# hadolint ignore=DL3016
|
||||||
|
RUN \
|
||||||
|
echo "==running NPM install==" \
|
||||||
|
&& npm install \
|
||||||
|
&& cp /extract/angular.json /extract/tsconfig.json /extract/build \
|
||||||
|
&& cp -Rf /extract/src /extract/build \
|
||||||
|
&& ng build --prod
|
||||||
|
|
||||||
|
|
||||||
# hadolint ignore=DL3007
|
# hadolint ignore=DL3007
|
||||||
FROM ghcr.io/truecharts/ubuntu:latest
|
FROM ghcr.io/truecharts/ubuntu:latest
|
||||||
@@ -45,19 +54,26 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|||||||
|
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --chown=apps:apps --from=builder [ "/extract/backend/package.json", "/extract/backend/package-lock.json", "/app/" ]
|
||||||
|
|
||||||
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016
|
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL3003,DL3016
|
||||||
RUN \
|
RUN \
|
||||||
apt-get -qq update \
|
apt-get -qq update \
|
||||||
&& \
|
&& \
|
||||||
apt-get -qq install -y \
|
apt-get -qq install -y \
|
||||||
nodejs \
|
nodejs \
|
||||||
youtube-dl \
|
npm \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
unzip \
|
|
||||||
python \
|
python \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
atomicparsley \
|
atomicparsley \
|
||||||
|
&& echo "==Installing youtubedl-material==" \
|
||||||
|
&& npm install \
|
||||||
|
&& printf "UpdateMethod=docker\nPackageVersion=%s\nPackageAuthor=[TrueCharts Project](https://truecharts.org)" "${VERSION}" > /app/package_info \
|
||||||
&& echo "==Running Cleanup ==" \
|
&& echo "==Running Cleanup ==" \
|
||||||
|
&& apt-get remove -y \
|
||||||
|
npm \
|
||||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||||
&& apt-get autoremove -y \
|
&& apt-get autoremove -y \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@@ -72,9 +88,9 @@ RUN \
|
|||||||
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
|
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
|
||||||
&& update-ca-certificates
|
&& update-ca-certificates
|
||||||
|
|
||||||
COPY --from=builder --chown=apps:apps /app /app
|
COPY --chown=apps:apps --from=builder [ "/extract/build/backend/public/", "/app/public/" ]
|
||||||
|
COPY --chown=apps:apps --from=builder [ "/extract/backend/", "/app/" ]
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
USER apps
|
USER apps
|
||||||
VOLUME /data/appdata
|
VOLUME /data/appdata
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user