Skip to content

Commit

Permalink
feat(hass): run as non-root (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
onedr0p committed May 15, 2024
1 parent 85811a6 commit a1e30b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions apps/home-assistant/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ RUN \
uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \
homeassistant=="${VERSION}" \
&& \
mkdir -p /config \
&& chown nobody:nogroup -R /config \
&& \
apk del --purge .build-deps \
&& \
rm -rf \
Expand All @@ -100,6 +103,10 @@ RUN \

COPY ./apps/home-assistant/entrypoint.sh /entrypoint.sh

USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

ENTRYPOINT ["/usr/bin/catatonit", "--"]
CMD ["/entrypoint.sh"]

Expand Down
3 changes: 0 additions & 3 deletions apps/home-assistant/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/usr/bin/env bash

mkdir -p /config/logs

if [[ "${HOME_ASSISTANT__HACS_INSTALL}" == "true" ]]; then
curl -sfSL https://hacs.xyz/install | bash -
fi

exec \
/usr/local/bin/hass \
--config /config \
--log-file /config/logs/home-assistant.log \
"$@"

0 comments on commit a1e30b0

Please sign in to comment.