Code Monkey home page Code Monkey logo

weewx-docker's Introduction

weewx-docker ๐ŸŒฉ๐Ÿณ

GitHub Build Status CodeQL WeeWX Version

Docker Pulls Docker Image Size (latest by date) Platforms

This docker container can be used to quickly get a WeeWX instance up and running.

This container has the following WeeWX extensions installed:

Notes

This GitHub repo is forked from felddy/weewx-docker (great work! ๐Ÿ‘).

It uses a forked and modified version of the interceptor extension to provide basic support for the Ecowitt WH57. This sensor will provide some information on lightning strikes in an area around the weather station. Note that currently only the count and distance can be stored in a WeeWX database without further modifications.

Usage

Install

Pull floydsteam/weewx from the Docker repository:

docker pull floydsteam/weewx

Run

The easiest way to start the container is to create a docker-compose.yml similar to the following. If you use a serial port to connect to your weather station, make sure the container has permissions to access the port. The uid/gid can be set using the environment variables below.

Modify any paths or devices as needed:

---
version: "3.8"

volumes:
  data:

services:
  weewx:
    image: floydsteam/weewx
    init: true
    restart: "yes"
    volumes:
      - type: bind
        source: ./data
        target: /data
    environment:
      - TIMEZONE=US/Eastern
      - WEEWX_UID=weewx
      - WEEWX_GID=dialout
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
  1. Create a directory on the host to store the configuration and database files:

    mkdir data
  2. If this is the first time running weewx, use the following command to start the container and generate a configuration file:

    docker-compose run weewx
  3. The configuration file will be created in the data directory. You should edit this file to match the setup of your weather station.

  4. When you are satisfied with configuration the container can be started in the background with:

    docker-compose up -d

Upgrading

  1. Stop the running container:

    docker-compose down
  2. Pull the new images from the Docker hub:

    docker-compose pull
  3. Update your configuration file (a backup will be created):

    docker-compose run weewx --upgrade
  4. Read through the new configuration and verify. It is helpful to diff the new config with the backup. Check the WeeWX Upgrade Guide for instructions for specific versions.

  5. Start the container up with the new image version:

    docker-compose up -d

Volumes

Mount point Purpose
/data configuration file and sqlite database storage

Environment Variables

Variable Purpose Default
TIMEZONE Container TZ database name UTC
WEEWX_UID uid the daemon will be run under weewx
WEEWX_GID gid the deamon will be run under weewx

Building from source

Build the image locally using this git repository as the build context:

docker build \
  --tag floydsteam/weewx:4.5.1 \
  https://github.com/floydsteam/weewx-docker.git#develop

Cross-platform builds

To create images that are compatible with other platforms you can use the buildx feature of Docker:

  1. Copy the project to your machine using the Clone button above or the command line:

    git clone https://github.com/floydsteam/weewx-docker.git
    cd weewx-docker
  2. Create the Dockerfile-x file with buildx platform support:

    ./buildx-dockerfile.sh
  3. Build the image using buildx:

    docker buildx build \
      --file Dockerfile-x \
      --platform linux/amd64 \
      --output type=docker \
      --tag floydsteam/weewx:4.5.1 .

Debugging

There are a few helper arguments that can be used to diagnose container issues in your environment.

Purpose Command
Generate the default configuration docker-compose run weewx
Upgrade a previous configuration docker-compose run weewx --upgrade
Generate a test (simulator) configuration docker-compose run weewx --gen-test-config
Drop into a shell in the container docker-compose run weewx --shell

New Repositories from a Skeleton

Please see our Project Setup guide for step-by-step instructions on how to start a new repository from a skeleton. This will save you time and effort when configuring a new repository!

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

This project is in the worldwide public domain.

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

weewx-docker's People

Contributors

felddy avatar mcdonnnj avatar jsf9k avatar floydsteam avatar dependabot[bot] avatar hillaryj avatar wvolz avatar marchagen avatar dav3r avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.