From 5dae08de63eb5a8f5a9586a496074c8e7a5893b2 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 12 Dec 2024 04:32:05 +0100 Subject: [PATCH] Add container; fix typo --- Containerfile | 10 ++++++++++ src/tinysteady_mailer/tsmailer.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Containerfile diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..6472fa4 --- /dev/null +++ b/Containerfile @@ -0,0 +1,10 @@ +# Build: podman build -t code.philo.ydns.eu/philorg/tinyseady-mailer -f Containerfile + +FROM docker.io/python:3.12-alpine +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/ + +COPY . /src +WORKDIR /src +RUN uv sync --frozen --no-cache && uv pip install --system . + +CMD tinysteady-mailer diff --git a/src/tinysteady_mailer/tsmailer.py b/src/tinysteady_mailer/tsmailer.py index fb3b7db..c2481ad 100755 --- a/src/tinysteady_mailer/tsmailer.py +++ b/src/tinysteady_mailer/tsmailer.py @@ -206,7 +206,7 @@ async def mailer(): last_failure = sorted(failure_files, key=lambda f: f.lstat().st_mtime)[-1] users = read_json(last_failure) if len(users) == 0: - logger.info(f"No record in {last_failure} file, existing.") + logger.info(f"No record in {last_failure} file. Nothing to do, exiting.") sys.exit(0) logger.info( f"Using a file with {len(users)} failed attempts for this config ({last_failure})"