Archived
1
0
Fork 0
This repository has been archived on 2024-07-01. You can view files and clone it, but cannot push or open issues or pull requests.
weewx-docker/Dockerfile

64 lines
2 KiB
Docker
Raw Normal View History

2022-01-30 22:11:34 +00:00
FROM python:3 as stage-1
ENV WEEWX_HOME="/home/weewx"
2022-05-16 21:41:12 +00:00
ENV ARCHIVE="weewx-4.8.0.tar.gz"
2022-07-10 10:35:12 +00:00
ENV NEOWX_VERSION="latest"
ENV WDC_VERSION="v1.3.1"
2022-01-30 22:11:34 +00:00
RUN addgroup --system --gid 421 weewx &&\
adduser --system --uid 421 --ingroup weewx weewx
WORKDIR /tmp
COPY requirements.txt ./
2022-07-10 17:12:38 +00:00
# Python setup
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --no-cache-dir --requirement requirements.txt
2022-01-30 22:11:34 +00:00
# WeeWX setup
RUN wget -O "${ARCHIVE}" "http://www.weewx.com/downloads/released_versions/${ARCHIVE}" &&\
2022-07-12 11:09:31 +00:00
wget -O weewx-interceptor.zip https://github.com/nifoc/weewx-interceptor/archive/refs/heads/feature/ecowitt-fields.zip &&\
2022-07-10 13:26:14 +00:00
wget -O weewx-forecast.zip https://github.com/chaunceygardiner/weewx-forecast/archive/master.zip &&\
2022-07-10 10:35:12 +00:00
wget -O neowx-material.zip https://neoground.com/projects/neowx-material/download/${NEOWX_VERSION} &&\
wget -O weewx-wdc.zip https://github.com/Daveiano/weewx-wdc/releases/download/${WDC_VERSION}/weewx-wdc-${WDC_VERSION}.zip &&\
2022-01-30 22:11:34 +00:00
tar --extract --gunzip --directory ${WEEWX_HOME} --strip-components=1 --file "${ARCHIVE}" &&\
2022-07-10 10:40:59 +00:00
mkdir weewx-wdc && unzip weewx-wdc.zip -d weewx-wdc &&\
2022-01-30 22:11:34 +00:00
chown -R weewx:weewx ${WEEWX_HOME}
WORKDIR ${WEEWX_HOME}
RUN bin/wee_extension --install /tmp/weewx-interceptor.zip &&\
2022-07-10 13:26:14 +00:00
bin/wee_extension --install /tmp/weewx-forecast.zip &&\
2022-07-10 10:35:12 +00:00
bin/wee_extension --install /tmp/neowx-material.zip &&\
2022-07-10 10:40:59 +00:00
bin/wee_extension --install /tmp/weewx-wdc &&\
2022-01-30 22:11:34 +00:00
mkdir user
2022-07-10 17:12:38 +00:00
2022-01-30 22:11:34 +00:00
COPY entrypoint.sh ./
COPY user/ ./bin/user/
FROM python:3 as stage-2
ENV WEEWX_HOME="/home/weewx"
RUN addgroup --system --gid 421 weewx &&\
adduser --system --uid 421 --ingroup weewx weewx
RUN apt-get update -qq -y &&\
DEBIAN_FRONTEND=noninteractive apt-get install -y libusb-1.0-0 gosu busybox-syslogd tzdata nginx-light -qq -y --no-install-recommends &&\
rm -rf /var/lib/apt/lists/*
WORKDIR ${WEEWX_HOME}
COPY --from=stage-1 /opt/venv /opt/venv
COPY --from=stage-1 ${WEEWX_HOME} ${WEEWX_HOME}
RUN mkdir /data && \
cp weewx.conf /data
VOLUME ["/data"]
ENV PATH="/opt/venv/bin:$PATH"
ENTRYPOINT ["./entrypoint.sh"]
CMD ["/data/weewx.conf"]