-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from tomdotorg/weewx-5
weewx-5
- Loading branch information
Showing
885 changed files
with
236,042 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,73 @@ | ||
FROM alpine:3.17.0 | ||
MAINTAINER Tom Mitchell "[email protected]" | ||
FROM debian:bookworm-slim | ||
|
||
MAINTAINER Tom Mitchell "[email protected]" | ||
ENV VERSION=5.1.0 | ||
ENV TAG=v5.1.0 | ||
ENV WEEWX_ROOT=/home/weewx/weewx-data | ||
ENV WEEWX_VERSION=4.10.0 | ||
ENV HOME=/home/weewx | ||
ENV TZ=America/New_York | ||
ENV PATH=/usr/bin:$PATH | ||
|
||
# && apt-get install curl bash python3 python3-dev python3-pip python3-venv gcc libc-dev libffi-dev tzdata rsync openssh-client openssl git -y | ||
|
||
RUN apt-get update \ | ||
&& apt-get install wget unzip python3 python3-dev python3-pip python3-venv tzdata rsync openssh-client openssl git libffi-dev python3-setuptools libjpeg-dev -y | ||
#RUN python3 -m pip install pip --upgrade \ | ||
# && python3 -m pip install setuptools \ | ||
# && python3 -m pip install cryptography \ | ||
# && python3 -m pip install paho-mqtt | ||
|
||
#wget http://www.weewx.com/downloads/released_versions/weewx-4.9.1.tar.gz -O /tmp/weewx.tgz \ | ||
# && cd /tmp && tar zxvf /tmp/weewx*.tgz \ | ||
# && cd weewx-* && python3 ./setup.py build && python3 ./setup.py install --no-prompt \ | ||
RUN addgroup weewx \ | ||
&& useradd -m -g weewx weewx \ | ||
&& chown -R weewx:weewx /home/weewx \ | ||
&& chmod -R 755 /home/weewx | ||
|
||
ADD dist/weewx-$WEEWX_VERSION /tmp/weewx/ | ||
COPY conf-fragments/ /tmp/ | ||
RUN apk add --update --no-cache --virtual deps gcc zlib-dev jpeg-dev python3-dev build-base linux-headers freetype-dev py3-pip alpine-conf \ | ||
&& apk add --no-cache python3 py3-pyserial py3-usb py3-pymysql sqlite wget rsync openssh tzdata \ | ||
&& ln -sf python3 /usr/bin/python \ | ||
&& pip3 install --no-cache --upgrade Cheetah3 Pillow image pyephem setuptools requests dnspython paho-mqtt configobj \ | ||
&& cd /tmp/weewx \ | ||
&& python3 ./setup.py build \ | ||
&& python3 ./setup.py install --no-prompt \ | ||
&& mkdir -p /var/log/weewx /tmp/weewx /home/weewx/public_html \ | ||
&& rm -rf /tmp/weewx \ | ||
&& apk del deps \ | ||
&& cat /tmp/*.conf >> /home/weewx/weewx.conf \ | ||
&& rm -rf /tmp/*.conf \ | ||
&& sed -i -e s:unspecified:Simulator: /home/weewx/weewx.conf | ||
CMD ["/home/weewx/bin/weewxd", "/home/weewx/weewx.conf"] | ||
USER weewx | ||
RUN python3 -m venv /home/weewx/weewx-venv \ | ||
&& chmod -R 755 /home/weewx \ | ||
&& . /home/weewx/weewx-venv/bin/activate \ | ||
&& python3 -m pip install Pillow \ | ||
&& python3 -m pip install CT3 \ | ||
&& python3 -m pip install configobj \ | ||
&& python3 -m pip install paho-mqtt \ | ||
# If your hardware uses a serial port | ||
&& python3 -m pip install pyserial \ | ||
# If your hardware uses a USB port | ||
&& python3 -m pip install pyusb \ | ||
# If you want extended celestial information: | ||
&& python3 -m pip install ephem \ | ||
# If you use MySQL or Maria | ||
&& python3 -m pip install PyMySQL \ | ||
# If you use sqlite | ||
&& python3 -m pip install db-sqlite3 | ||
|
||
#wget http://www.weewx.com/downloads/released_versions/weewx-4.9.1.tar.gz -O /tmp/weewx.tgz \ | ||
# && cd /tmp && tar zxvf /tmp/weewx*.tgz \ | ||
# && cd weewx-* && python3 ./setup.py build && python3 ./setup.py install --no-prompt \ | ||
RUN git clone https://github.com/weewx/weewx ~/weewx \ | ||
&& cd ~/weewx \ | ||
&& git checkout $TAG \ | ||
&& . /home/weewx/weewx-venv/bin/activate \ | ||
&& python3 ~/weewx/src/weectl.py station create --no-prompt | ||
COPY conf-fragments/* /home/weewx/tmp/conf-fragments/ | ||
RUN mkdir -p /home/weewx/tmp \ | ||
&& cat /home/weewx/tmp/conf-fragments/* >> /home/weewx/weewx-data/weewx.conf | ||
## Belchertown extension | ||
RUN cd /var/tmp \ | ||
&& . /home/weewx/weewx-venv/bin/activate \ | ||
&& wget https://github.com/poblabs/weewx-belchertown/releases/download/weewx-belchertown-1.3.1/weewx-belchertown-release.1.3.1.tar.gz \ | ||
&& tar zxvf weewx-belchertown-release.1.3.1.tar.gz \ | ||
&& cd weewx-belchertown-master \ | ||
&& python3 ~/weewx/src/weectl.py extension install -y . \ | ||
&& cd /var/tmp \ | ||
&& rm -rf weewx-belchertown-release.1.3.1.tar.gz weewx-belchertown-master \ | ||
## MQTT extension | ||
&& wget -O weewx-mqtt.zip https://github.com/matthewwall/weewx-mqtt/archive/master.zip \ | ||
&& unzip weewx-mqtt.zip \ | ||
&& cd weewx-mqtt-master \ | ||
&& . /home/weewx/weewx-venv/bin/activate \ | ||
&& python3 ~/weewx/src/weectl.py extension install -y . \ | ||
&& cd /var/tmp \ | ||
&& rm -rf weewx-mqtt.zip weewx-mqtt-master | ||
# | ||
ADD ./bin/run.sh $WEEWX_ROOT/bin/run.sh | ||
CMD $WEEWX_ROOT/bin/run.sh | ||
WORKDIR $WEEWX_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env sh | ||
|
||
HOME=/home/weewx | ||
WEEWX_ROOT=$HOME/weewx-data | ||
CONF_FILE=$WEEWX_ROOT/weewx.conf | ||
|
||
echo "HOME=$HOME" | ||
echo "using $CONF_FILE" | ||
echo "weewx is in $WEEWX_ROOT" | ||
echo "TZ=$TZ" | ||
cd $WEEWX_ROOT | ||
|
||
while true; do | ||
. /home/weewx/weewx-venv/bin/activate | ||
python3 $HOME/weewx/src/weewxd.py $CONF_FILE > /dev/stdout | ||
sleep 60 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
#!/usr/bin/env bash | ||
VERSION=4.10.0-1 | ||
REV=2 | ||
WEEWX_VERSION=5.1.0 | ||
IMAGE_VERSION=$WEEWX_VERSION-$REV | ||
VERSION=5.1.0-2 | ||
|
||
#docker build --no-cache -t mitct02/weewx:$VERSION . | ||
BUILDKIT_COLORS="run=123,20,245:error=yellow:cancel=blue:warning=white" docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7 -t mitct02/weewx:$VERSION . | ||
BUILDKIT_COLORS="run=123,20,245:error=yellow:cancel=blue:warning=white" docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t mitct02/weewx:$IMAGE_VERSION . | ||
#BUILDKIT_COLORS="run=123,20,245:error=yellow:cancel=blue:warning=white" docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t mitct02/weewx:$IMAGE_VERSION . | ||
#docker pull mitct02/weewx:$IMAGE_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.