Initial commit

This commit is contained in:
Thomas Klaehn 2021-02-18 08:39:38 +01:00
commit 4b3330c6c2
3 changed files with 34 additions and 0 deletions

19
Dockerfile Normal file
View File

@ -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"]

1
README.md Normal file
View File

@ -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

14
run.sh Executable file
View File

@ -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