From 5139c2d6121565d44927b11e34ed95b47494f0b6 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 11 Feb 2019 01:29:55 +0100 Subject: [PATCH] dockerize --- Dockerfile | 10 ++++++++++ docker-compose.yml | 18 ++++++++++++++++++ main.py | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bec059c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.7-alpine + +EXPOSE 4785 + +RUN pip3 install --no-cache-dir \ + matrix-client + +ADD main.py / + +CMD /main.py diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2834a05 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' + +networks: + web: + external: true + +services: + bot: + build: . + restart: unless-stopped + env_file: + - .env + networks: + - web + labels: + traefik.enable: "true" + traefik.frontend.rule: "Host: ${CHATONS_SERVICE:-wwm}.${CHATONS_DOMAIN:-localhost}, www.${CHATONS_SERVICE:-wwm}.${CHATONS_DOMAIN:-localhost}" + diff --git a/main.py b/main.py index 1ffdbfd..fd06fc2 100755 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ wifi-with-matrix script. Bridge between https://code.ffdn.org/FFDN/wifi-with-me & a matrix room @@ -62,4 +62,5 @@ class WWMBotForwarder(BaseHTTPRequestHandler): if __name__ == '__main__': + print('Wifi-With-Matrix bridge starting…') WWMBotServer(SERVER_ADDRESS, WWMBotForwarder).serve_forever()