Add Email-Forwarder watch container

This commit is contained in:
DonVoo 2026-07-05 22:09:53 +02:00
parent 88e82286d8
commit ba53f8bb19
5 changed files with 36 additions and 10 deletions

View file

@ -31,6 +31,7 @@ install -m0644 "$APP_DIR/Containerfile" "$APP_DIR/build/Containerfile"
podman build -t "$IMAGE_NAME" -f "$APP_DIR/build/Containerfile" "$APP_DIR/build"
podman rm -f "${WATCH_CONTAINER_NAME:-email-forwarder-watch}" >/dev/null 2>&1 || true
podman rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
podman pod rm -f "$POD_NAME" >/dev/null 2>&1 || true
podman pod create --name "$POD_NAME" --network "$NETWORK" -p "$HOST_BIND:$APP_PORT:$APP_PORT" >/dev/null
@ -40,6 +41,14 @@ podman run -d --name "$CONTAINER_NAME" --pod "$POD_NAME" \
-v "$APP_DIR/backup:/app/backup:Z" \
"$IMAGE_NAME" >/dev/null
if [ -n "${WATCH_ACCOUNT:-}" ]; then
podman run -d --name "${WATCH_CONTAINER_NAME:-email-forwarder-watch}" --pod "$POD_NAME" \
--restart=unless-stopped \
-v "$APP_DIR/data:/app/data:Z" \
-v "$APP_DIR/backup:/app/backup:Z" \
"$IMAGE_NAME" --run "$WATCH_ACCOUNT" --watch --watch-interval "${WATCH_INTERVAL:-60s}" >/dev/null
fi
for _ in {1..20}; do
if curl -fsS "http://$HOST_BIND:$APP_PORT/" >/dev/null 2>&1; then
echo "Email-Forwarder reachable at http://$HOST_BIND:$APP_PORT/"

View file

@ -5,6 +5,7 @@ set -a
source ./config.env
set +a
podman rm -f "${WATCH_CONTAINER_NAME:-email-forwarder-watch}" >/dev/null 2>&1 || true
podman rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
podman pod rm -f "$POD_NAME" >/dev/null 2>&1 || true
echo "Runtime removed. Persistent data kept at $APP_DIR/data and $APP_DIR/backup"

View file

@ -1,10 +1,13 @@
SERVICE_NAME=Email-Forwarder
POD_NAME=email-forwarder-pod
CONTAINER_NAME=email-forwarder
WATCH_CONTAINER_NAME=email-forwarder-watch
IMAGE_NAME=localhost/email-forwarder:test
NETWORK=base-net
HOST_BIND=127.0.0.1
APP_PORT=8087
WATCH_ACCOUNT=codex-to-vdevop03
WATCH_INTERVAL=60s
BUILD_SRC=/mnt/DATA/Build/Email-Forwarder
DEVOP_CONTAINER=DevOp-Pod-build
APP_DIR=/mnt/DATA/Containers/Test-Container/Email-Forwarder-Pod