|
1 | 1 | # https://developers.home-assistant.io/docs/add-ons/configuration#add-on-dockerfile |
2 | 2 | ARG BUILD_FROM |
3 | 3 | FROM $BUILD_FROM as compiler |
4 | | - |
5 | | -# Execute during the build of the image |
6 | 4 | ARG TEMPIO_VERSION BUILD_ARCH |
7 | | -RUN \ |
8 | | - curl -sSLf -o /usr/bin/tempio \ |
9 | | - "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" |
10 | | - |
11 | | -RUN apk add --no-cache git |
12 | | - |
| 5 | +RUN curl -sSLf -o /usr/bin/tempio "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" |
| 6 | +RUN apk add --no-cache uv git |
| 7 | +ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=0 |
13 | 8 | WORKDIR /app |
14 | | - |
15 | 9 | RUN git clone https://github.com/dmunozv04/iSponsorBlockTV /repo |
16 | | -RUN cp -r /repo/src/* . |
17 | | - |
| 10 | +# START PATCH (remove patch once isponsorblock is updated to aiohttp 3.11.12) |
| 11 | +RUN sed -i 's/aiohttp==3.9.5/aiohttp==3.11.12/g' /repo/requirements.txt && \ |
| 12 | + sed -i 's/pyytlounge==2.1.1/pyytlounge==2.1.2/g' /repo/requirements.txt |
| 13 | +RUN cd /repo && git config user.email "none" && git config user.name "none" && \ |
| 14 | + git revert ae6da834e492554d40c279fadff7cfa00b70ac0e && cd .. |
| 15 | +# END PATCH |
| 16 | +RUN cp -r /repo/src/* /app/ && cp /repo/requirements.txt /app/ |
| 17 | +RUN uv pip install --system -r requirements.txt |
| 18 | +# TODO: we need the below as UV_COMPILE_BYTECODE=1 is not working as expected, remove once fixed |
18 | 19 | RUN python3 -m compileall -b -f . && \ |
19 | 20 | find . -name "*.py" -type f -delete |
20 | 21 |
|
21 | 22 | FROM $BUILD_FROM |
22 | | - |
23 | | -ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256color COLORTERM=truecolor |
| 23 | +ENV iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256color COLORTERM=truecolor |
24 | 24 | WORKDIR /app |
25 | | - |
26 | | -COPY --from=compiler /repo/requirements.txt . |
27 | 25 | COPY --from=compiler /usr/bin/tempio /usr/bin/tempio |
28 | | - |
29 | | -RUN pip install --upgrade pip wheel && \ |
30 | | - pip install -r requirements.txt && \ |
31 | | - pip uninstall -y pip wheel && \ |
32 | | - python3 -m compileall -b -f /usr/local/lib/python3.*/site-packages && \ |
33 | | - find /usr/local/lib/python3.*/site-packages -name "*.py" -type f -delete && \ |
34 | | - find /usr/local/lib/python3.*/ -name "__pycache__" -type d -exec rm -rf {} + |
35 | | - |
36 | 26 | COPY --from=compiler /app . |
| 27 | +COPY --from=compiler /usr/local/lib/python*/site-packages /usr/local/lib/python3.13/site-packages/ |
37 | 28 | COPY rootfs/ / |
0 commit comments