summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2024-07-14 15:07:25 -0500
committerMark Powers <mark@marks.kitchen>2024-07-14 15:07:25 -0500
commita6f19ac417880536c89361b2593667e1294026e0 (patch)
tree7483de132d96887083e26c8f3a62362208829ab9
parent10593b1e128e37c3899eae78ac4dcce776f3ab81 (diff)
Dockerize applicationHEADmaster
-rw-r--r--Dockerfile12
-rw-r--r--on_this_day.py2
2 files changed, 13 insertions, 1 deletions
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 "</li>\n<li>".join(output) or "No holidays this fortnight."