From e23a36e734b4a2d7a38809cf81972af5c9bb6b29 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Thu, 26 Jul 2018 15:29:44 +0200 Subject: [PATCH] bicycle-statistics: Initial commit Signed-off-by: Thomas Klaehn --- Dockerfile | 21 +++++++++++++++++++++ README.md | 22 ++++++++++++++++++++++ run.sh | 16 ++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc59a25 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM debian:latest + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade -yq && \ + DEBIAN_FRONTEND=nonintercative apt-get install -yq python python-pip mosquitto git + +RUN yes | pip install paho-mqtt +RUN yes | pip install watchdog +RUN yes | pip install geopy +RUN yes | pip install gpxpy +RUN yes | pip install matplotlib +RUN yes | pip install pandas +RUN yes | pip install numpy + +RUN git clone https://git.blackfinn.de/python/bicycle-statistics.git +RUN cd bicycle-statistics && python setup.py install +RUN rm -rf bicycle-statistics + +COPY run.sh /bin/ + +ENTRYPOINT [ "/bin/run.sh" ] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8f02486 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# bicycle statistics + +Observe `` for `gpx` files and create a html statistics page based on it at ``. + +## Build + +```sh +docker build -t . +``` + +## Run + +```sh +docker run -d -v :/bs_in -v :/bs_out --name --restart always +``` + +## Example + +```sh +docker build -t bicycle_statistics_creator . +docker run -d -v /srv/nextcloud/data/tkl/files/Bicycle:/bs_in -v /srv/bicycle.blackfinn.de/data:/bs_out --name bicycle-statistics --restart always bicycle_statistics_creator +``` \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..ae3017b --- /dev/null +++ b/run.sh @@ -0,0 +1,16 @@ +#!/bin/bash +/etc/init.d/mosquitto start + +sleep 1 + +/usr/local/bin/bicycle-stat /bs_in /bs_out + +# if argument(s) given - execute argument(s) in container. Otherwise loop. +if [ "$#" -gt 0 ]; then + exec $@ +else + while :; + do + sleep 1 + done +fi