From 895228eb3834034e0283e4c6d870b63c4d16e6b0 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 10 Jul 2022 19:12:38 +0200 Subject: [PATCH] Support weewx-wdc custom skin.conf --- Dockerfile | 11 ++++++----- entrypoint.sh | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b18ecf6..e3eaf31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,11 @@ RUN addgroup --system --gid 421 weewx &&\ WORKDIR /tmp COPY requirements.txt ./ +# Python setup +RUN python -m venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" +RUN pip install --no-cache-dir --requirement requirements.txt + # WeeWX setup RUN wget -O "${ARCHIVE}" "http://www.weewx.com/downloads/released_versions/${ARCHIVE}" &&\ wget -O weewx-interceptor.zip https://github.com/matthewwall/weewx-interceptor/archive/master.zip &&\ @@ -21,11 +26,6 @@ RUN wget -O "${ARCHIVE}" "http://www.weewx.com/downloads/released_versions/${ARC mkdir weewx-wdc && unzip weewx-wdc.zip -d weewx-wdc &&\ chown -R weewx:weewx ${WEEWX_HOME} -# Python setup -RUN python -m venv /opt/venv -ENV PATH="/opt/venv/bin:$PATH" -RUN pip install --no-cache-dir --requirement requirements.txt - WORKDIR ${WEEWX_HOME} RUN bin/wee_extension --install /tmp/weewx-interceptor.zip &&\ @@ -33,6 +33,7 @@ RUN bin/wee_extension --install /tmp/weewx-interceptor.zip &&\ bin/wee_extension --install /tmp/neowx-material.zip &&\ bin/wee_extension --install /tmp/weewx-wdc &&\ mkdir user + COPY entrypoint.sh ./ COPY user/ ./bin/user/ diff --git a/entrypoint.sh b/entrypoint.sh index 1e8bf49..a5f2c6d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,6 +28,11 @@ if [ "$(id -u)" = 0 ]; then ln -s /data/neowx-material-skin.conf ./skins/neowx-material/skin.conf fi + if [ -e /data/weewx-wdc-skin.conf ]; then + rm -f ./skins/weewx-wdc/skin.conf + ln -s /data/weewx-wdc-skin.conf ./skins/weewx-wdc/skin.conf + fi + if [ "${WEEWX_UID:-weewx}" != 0 ]; then # drop privileges and restart this script echo "Switching uid:gid to ${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}"