From 4b3330c6c26753d6af445b79d88dcad9b0b0554d Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Thu, 18 Feb 2021 08:39:38 +0100 Subject: [PATCH] Initial commit --- Dockerfile | 19 +++++++++++++++++++ README.md | 1 + run.sh | 14 ++++++++++++++ 3 files changed, 34 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..4434fb0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine:latest +RUN apk update && apk upgrade +RUN apk add --update --no-cache python3 python3-dev py-pip git build-base freetype-dev nginx + +RUN pip install --upgrade pip && \ + pip install wheel && \ + pip install gunicorn \ + pip install flask + +RUN git clone https://git.blackfinn.de/python/weblight.git +RUN cd weblight && python3 setup.py install +RUN rm -rf weblight + +RUN mkdir -p /run/nginx + +COPY run.sh /bin/ + +ENTRYPOINT ["/bin/run.sh"] + diff --git a/README.md b/README.md new file mode 100644 index 0000000..7510096 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +docker run --detach --restart always --name weblight --cap-add SYS_RAWIO --device=/dev/mem:/dev/mem --device=/dev/gpiomem:/dev /gpiomem --publish 80:80 weblight diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..75f0a2d --- /dev/null +++ b/run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +gunicorn --bind 0.0.0.0:80 weblight:app + + +# if argument(s) given - execute argument(s) in container. Otherwise loop. +if [ "$#" -gt 0 ]; then + exec $@ +else + while :; + do + sleep 1 + done +fi +