From a6f19ac417880536c89361b2593667e1294026e0 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sun, 14 Jul 2024 15:07:25 -0500 Subject: Dockerize application --- Dockerfile | 12 ++++++++++++ on_this_day.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f0b13e1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.9-slim + +RUN apt update -y && apt install -y calendar + +RUN pip install requests beautifulsoup4 lxml + +COPY config.py . +COPY main.py . +COPY on_this_day.py . +COPY config.py . + +CMD python main.py diff --git a/on_this_day.py b/on_this_day.py index 970cec9..96e8a69 100644 --- a/on_this_day.py +++ b/on_this_day.py @@ -31,7 +31,7 @@ def get_today_wikipedia(): def get_week_holidays(): print("getting holidays") - command = "calendar -f /usr/share/calendar/calendar.mark -A 14".split(" ") + command = "calendar -f /data/calendar.mark -A 14".split(" ") output = subprocess.check_output(command) output = output.decode("utf-8").strip().split("\n") return "\n
  • ".join(output) or "No holidays this fortnight." -- cgit v1.2.3