diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 3a55ac7..ed62227 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -41,7 +41,7 @@ jobs: fi if [[ ${{ inputs.eventname }} == 'pull_request' ]]; then - echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV + echo "PLATFORMS=linux/arm/v6" >> $GITHUB_ENV else echo "PLATFORMS=${{ inputs.platforms }}" >> $GITHUB_ENV fi diff --git a/Docker/PlexAniSync/Dockerfile b/Docker/PlexAniSync/Dockerfile index 1654e32..69abe03 100644 --- a/Docker/PlexAniSync/Dockerfile +++ b/Docker/PlexAniSync/Dockerfile @@ -1,17 +1,38 @@ -FROM python:3.11 AS builder +ARG python_version=3.12 + +FROM ubuntu AS base +ARG python_version + +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update && \ + apt-get install -y python-${python_version} python3-pip && \ + apt-get clean && rm -rf /var/lib/apt/lists/* && \ + python3 -m pip install pip && \ + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + +FROM base AS builder + +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUN apt-get update && \ apt-get install -y \ build-essential \ + rustc \ + git \ && apt-get clean && rm -rf /var/lib/apt/lists/* RUN pip install --upgrade pip COPY Docker/PlexAniSync/pip.conf /etc/pip.conf COPY requirements.txt . # install dependencies to the local user directory (eg. /root/.local) -RUN pip install --user --no-warn-script-location -r requirements.txt +RUN --mount=type=tmpfs,target=/root/.cargo \ + CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \ + CARGO_HOME=/root/.cargo \ + pip install --user --no-warn-script-location -r requirements.txt -FROM python:3.11-slim +FROM base +ARG python_version WORKDIR /plexanisync @@ -20,7 +41,7 @@ COPY --from=builder /root/.local /root/.local RUN chmod -R a+rX /root # update PATH environment variable ENV PATH=/root/.local:$PATH -ENV PYTHONPATH=/root/.local/lib/python3.11/site-packages +ENV PYTHONPATH=/root/.local/lib/python${python_version}/site-packages ENV PLEX_SECTION=Anime \ PLEX_URL=http://127.0.0.1:32400 \