From b72bdeffd3b76cc9e5bb6e1d1b7a1d45a39d9dfb Mon Sep 17 00:00:00 2001 From: jblu Date: Tue, 16 May 2023 12:38:40 -0500 Subject: [PATCH] added docker build file --- .gitignore | 2 +- Dockerfile | 6 ++++++ apprise-client.py | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index bb746ec..9395fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.toml - +*docker_test* # ---> Python # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f400d5d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:alpine3.18 +WORKDIR / +COPY apprise-client.py opt +ENV toml_path='' +RUN pip install requests +CMD [ "python", "opt/apprise-client.py" ] \ No newline at end of file diff --git a/apprise-client.py b/apprise-client.py index ea068ef..5a570e1 100644 --- a/apprise-client.py +++ b/apprise-client.py @@ -1,7 +1,12 @@ import requests as r from tomllib import load +import os + +if os.environ["toml_path"]: + config_file_path=os.environ["toml_path"] +else: + config_file_path = './config.toml' -config_file_path = './config.toml' with open(config_file_path, 'rb') as c: config = load(c)