Install anipy-cli systemwide during the Docker build so fallback downloads work inside the container without extra setup, and update the README to describe the new Docker behavior.
76 lines
2.3 KiB
Docker
76 lines
2.3 KiB
Docker
FROM python:3.12-slim
|
|
|
|
ARG ANI_CLI=https://github.com/pystardust/ani-cli.git
|
|
ARG ANI_CLI_BRANCH=master
|
|
ARG ANI_CLI_WEB=https://gitea.coreplay.eu/Dymas/ani-cli-web.git
|
|
ARG ANI_CLI_WEB_BRANCH=main
|
|
ARG YT_DLP_RELEASE_URL=https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
ANI_CLI_REPO=${ANI_CLI} \
|
|
ANI_CLI_BRANCH=${ANI_CLI_BRANCH} \
|
|
ANI_CLI_WEB_REPO=${ANI_CLI_WEB} \
|
|
ANI_CLI_WEB_BRANCH=${ANI_CLI_WEB_BRANCH} \
|
|
ANI_CLI_BIN=ani-cli \
|
|
ANI_CLI_DOWNLOAD_DIR=/downloads \
|
|
ANI_CLI_WEB_HOST=0.0.0.0 \
|
|
ANI_CLI_WEB_PORT=8421 \
|
|
UPDATE_ON_START=false \
|
|
USER_UID= \
|
|
USER_GID=
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
aria2 \
|
|
ca-certificates \
|
|
curl \
|
|
ffmpeg \
|
|
fzf \
|
|
git \
|
|
grep \
|
|
openssl \
|
|
patch \
|
|
sed \
|
|
sudo \
|
|
util-linux \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN git clone --depth 1 --branch "${ANI_CLI_BRANCH}" "${ANI_CLI}" /tmp/ani-cli-src \
|
|
&& install -m 0755 /tmp/ani-cli-src/ani-cli /usr/local/bin/ani-cli \
|
|
&& ani_cli_raw_repo="$(printf '%s' "${ANI_CLI}" | sed -E 's#^https://github.com/##; s#\\.git$##')" \
|
|
&& case "${ANI_CLI}" in \
|
|
https://github.com/*) \
|
|
sed -i "s|https://raw.githubusercontent.com/pystardust/ani-cli/master/ani-cli|https://raw.githubusercontent.com/${ani_cli_raw_repo}/${ANI_CLI_BRANCH}/ani-cli|" /usr/local/bin/ani-cli ;; \
|
|
esac \
|
|
&& rm -rf /tmp/ani-cli-src
|
|
|
|
RUN curl -fL "${YT_DLP_RELEASE_URL}" -o /usr/local/bin/yt-dlp \
|
|
&& chmod 0755 /usr/local/bin/yt-dlp \
|
|
&& yt-dlp --version
|
|
|
|
RUN python3 -m pip install --no-cache-dir anipy-cli \
|
|
&& anipy-cli --version
|
|
|
|
RUN git clone --depth 1 --branch "${ANI_CLI_WEB_BRANCH}" "${ANI_CLI_WEB}" /app \
|
|
&& rm -rf /app/.git \
|
|
&& rm -f \
|
|
/app/.dockerignore \
|
|
/app/.gitignore \
|
|
/app/Dockerfile \
|
|
/app/README.md \
|
|
/app/ani-cli-web \
|
|
/app/docker-compose.yaml \
|
|
/app/docker-entrypoint.sh \
|
|
/app/test_app.py
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
|
|
RUN chmod 0755 /usr/local/bin/docker-entrypoint.sh \
|
|
&& mkdir -p /downloads /app/.ani-cli-web
|
|
|
|
WORKDIR /app
|
|
|
|
EXPOSE 8421
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|