From 1eaabc9c119a3fe144ac22ce16b40182b9f8963a Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Fri, 10 Apr 2020 12:00:12 +0200 Subject: [PATCH] Override entrypoint to run mailer --- Dockerfile | 4 ++++ sbin/entrypoint.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 sbin/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 2086786..14509ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,3 +7,7 @@ RUN /venv/bin/pip install git+https://github.com/alerta/alerta-contrib.git#subdi RUN /venv/bin/pip install dnspython==1.16.0 COPY . ${WORKDIR} + +COPY sbin/* /sbin/ + +ENTRYPOINT ["/sbin/entrypoint.sh"] diff --git a/sbin/entrypoint.sh b/sbin/entrypoint.sh new file mode 100755 index 0000000..94b5e44 --- /dev/null +++ b/sbin/entrypoint.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -eu -o pipefail + +run_alerta_mailer() { + set -eu + + alerta-mailer & + + echo "-----> alerta-mailer is running..." +} + +run_ps_background_check() { + set -eu + + ps -aux | grep -i mailer + + echo "-----> ps grep output ^^^" +} + +# Main entrypoint +main() { + set -eu + + run_alerta_mailer + run_ps_background_check +} + +main + + +usr/local/bin/docker-entrypoint.sh "$@"