From 14dfa67907a4b525df6cf53669da437e99073924 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Thu, 5 Sep 2019 08:16:37 +0200 Subject: [PATCH] dockerization --- Dockerfile | 7 +++++++ check.py | 13 ++----------- requirements.txt | 7 +++++++ 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f5bfab7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.7 +ENV DB_FILE=checks.json +WORKDIR /app +COPY requirements.txt . +RUN python -m pip install -r requirements.txt +COPY check.py . +CMD ["python", "./check.py"] diff --git a/check.py b/check.py index b87c76e..5fb7003 100644 --- a/check.py +++ b/check.py @@ -4,20 +4,11 @@ import hashlib import time import datetime import tinydb +import os pushover.init('abz8is31hd3m2e36g62w4msihj87cr') -db = tinydb.TinyDB('checks.json') -Entry = tinydb.Query() - -#db.insert({ -# 'url': 'https://www.europapark.de/de/uebernachten/alle-angebote/sommersaison/europa-rundreise', -# 'hash':'' -#}) -#db.insert({ -# 'url': 'https://www.europapark.de/de/uebernachten/alle-angebote/sommerangebote', -# 'hash':'' -#}) +db = tinydb.TinyDB(os.getenv('DB_FILE',default='checks.json')) while True: entries = db.all() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f867af9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +certifi==2019.6.16 +chardet==3.0.4 +idna==2.8 +python-pushover==0.4 +requests==2.22.0 +tinydb==3.13.0 +urllib3==1.25.3