From 0d97cf57cc2c4b1a1325e3b1ab8aa956c7c1c885 Mon Sep 17 00:00:00 2001 From: Otthorn Date: Tue, 16 Mar 2021 00:36:50 +0100 Subject: [PATCH 1/2] Add Docker ecosystem --- Dockerfile | 21 +++++++++++++++++++++ docker-compose.yml | 10 ++++++++++ requirements.txt | 6 ++++++ 3 files changed, 37 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b0f3d0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.9-alpine +LABEL description="A Matrix bot for Kanboard" + +# Instal gcc to build wheels +RUN apk add --no-cache gcc musl-dev + +# Force the stdout and stderr streams to be unbuffered +ENV PYTHONUNBUFFERED 1 + +# Install requirements from PyPI +COPY requirements.txt /var/www/kanbot/ +RUN pip install --no-cache-dir -r /var/www/kanbot/requirements.txt + +# Copy the all the necessary files +COPY . /var/www/kanbot/ + +# Move the rigth directory +WORKDIR /var/www/kanbot + +EXPOSE 8080 +ENTRYPOINT /usr/bin/python3 /var/www/kanbot/bot.py diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d1e2999 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' + +services: + kanbot: + image: kanbot + restart: always + volumes: + - ./config.yaml:/var/www/kanbot/config.yaml:ro + ports: + - 8080:8080 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b4a1010 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +aiohttp>=3.7.4 +jinja2>=2.11.2 +markdown>=3.3.4 +matrix-nio>=0.17.0 +pyyaml>=5.4 + From fdddc5d7880a9b0ff43ad1b81a114df08e92d927 Mon Sep 17 00:00:00 2001 From: Otthorn Date: Tue, 16 Mar 2021 00:56:30 +0100 Subject: [PATCH 2/2] Remove trailing whitespace --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b4a1010..2be4913 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,3 @@ jinja2>=2.11.2 markdown>=3.3.4 matrix-nio>=0.17.0 pyyaml>=5.4 -