Skip to content

Commit

Permalink
fix(home-assistant): Disable UV cache, add go2rtc, Use explicit go2rt…
Browse files Browse the repository at this point in the history
…c version, set PYTHONPATH
  • Loading branch information
joryirving committed Nov 7, 2024
1 parent 4071115 commit 0892bf0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions apps/home-assistant/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ ENV \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_BREAK_SYSTEM_PACKAGES=1 \
UV_SYSTEM_PYTHON=true \
UV_NO_CACHE=true \
CRYPTOGRAPHY_DONT_BUILD_RUST=1 \
HOMEASSISTANT_WHEELS="https://wheels.home-assistant.io/musllinux/" \
HOME="/config"
HOME="/config" \
PYTHONPATH="/config/deps"

ENV UMASK="0002" \
TZ="Etc/UTC"
Expand All @@ -45,6 +47,7 @@ RUN \
eudev-libs \
ffmpeg \
git \
go2rtc \
iputils \
jo \
jq \
Expand Down Expand Up @@ -90,22 +93,26 @@ RUN \
case "${TARGETPLATFORM}" in \
'linux/amd64') \
export ARCH='amd64'; \
export GO2RTC_SUFFIX='amd64'; \
;; \
'linux/arm64') \
export ARCH='aarch64'; \
export GO2RTC_SUFFIX='arm64'; \
;; \
esac \
&& \
HOME_ASSISTANT_BASE=$(curl -fsSL "https://raw.githubusercontent.com/home-assistant/core/${VERSION}/build.yaml" | grep "${ARCH}: " | cut -d ":" -f3) \
&& \
uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
--requirement "https://raw.githubusercontent.com/home-assistant/docker/${HOME_ASSISTANT_BASE}/requirements.txt" \
&& \
uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
--requirement /tmp/requirements_all.txt \
&& \
uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
uv pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
homeassistant=="${VERSION}" \
&& curl -L https://github.com/AlexxIT/go2rtc/releases/download/v1.9.6/go2rtc_linux_${GO2RTC_SUFFIX} --output /bin/go2rtc \
&& chmod +x /bin/go2rtc \
&& mkdir -p /config && chown nobody:nogroup -R /config \
&& apk del --purge .build-deps \
&& rm -rf /root/.cache /root/.cargo /tmp/*
Expand Down

0 comments on commit 0892bf0

Please sign in to comment.