From 74e6488044ffb8e2187cfe4fa1ee773b1e0c6ae0 Mon Sep 17 00:00:00 2001 From: "Maxence G. de Montauzan" Date: Thu, 7 Sep 2023 00:37:59 +0200 Subject: [PATCH] Dockerfile & docker compose Adapt configuration for tests purposes Justfile to simplificate flow --- Dockerfile | 10 ++++++++++ Justfile | 17 +++++++++++++++++ conf.ini | 4 ++-- docker-compose.yml | 15 +++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 Justfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e568243 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.10-alpine3.18 + +RUN pip install requests +WORKDIR /app +COPY notifier.py template.html /app/ + +# TODO Dev purporse +COPY conf.ini /app/conf.ini + +ENTRYPOINT ["python3", "/app/notifier.py"] diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..37f458c --- /dev/null +++ b/Justfile @@ -0,0 +1,17 @@ +# https://github.com/casey/just + +up: build + docker compose up -d + docker compose logs + +build: + docker compose build + +rebuild: down + docker compose build + +down: + docker compose down + +force-build: + docker compose build --no-cache diff --git a/conf.ini b/conf.ini index 15bbe66..81cebf5 100644 --- a/conf.ini +++ b/conf.ini @@ -1,7 +1,7 @@ [config] github_api_url = https://api.github.com/repos/ -smtp_port = 25 -smtp_server = localhost +smtp_port = 1025 +smtp_server = mailhog sender_email = sender@host.eu receiver_email = receiver@anotherhost.eu diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fb79932 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + notifier: + build: . + image: github-release-notifier:1 + container_name: github-release-notifier + volumes: + - ./conf.ini:/app/conf.ini + + mailhog: + image: mailhog/mailhog:v1.0.1 + ports: + - "8025:8025" + - "1025:1025"