From ca30887fc7ca1a93b86000e0811951589798247a Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Mon, 5 Feb 2024 00:23:09 -0500 Subject: [PATCH] feat(pod): link all services under a single pod --- pod.sh | 4 ++++ services/bitwarden/start.sh | 7 ++----- services/bookstack/start.sh | 10 ++++------ services/deluge/start.sh | 7 +------ services/plex/start.sh | 3 --- 5 files changed, 11 insertions(+), 20 deletions(-) create mode 100644 pod.sh diff --git a/pod.sh b/pod.sh new file mode 100644 index 0000000..17abf74 --- /dev/null +++ b/pod.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +podman pod exists services +test $? -eq 0 || podman pod create services diff --git a/services/bitwarden/start.sh b/services/bitwarden/start.sh index 704d0f1..02d5c04 100644 --- a/services/bitwarden/start.sh +++ b/services/bitwarden/start.sh @@ -2,11 +2,9 @@ source constants.sh -podman network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists" - podman run \ --detach \ - --network $NETWORK_NAME \ + --pod services \ --name $DB_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/bitwarden-db.env \ --mount type=bind,source=$APP_DATA_DIR/bitwarden/db,target=/var/lib/mysql \ @@ -14,10 +12,9 @@ podman run \ podman run \ --detach \ - --network $NETWORK_NAME \ + --pod services \ --name $APP_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/bitwarden-web.env \ - --publish 8080:8080 \ --mount type=bind,source=$APP_DATA_DIR/bitwarden/config,target=/etc/bitwarden \ --mount type=bind,source=$APP_DATA_DIR/bitwarden/logs,target=/var/log/bitwarden \ $APP_IMAGE_NAME:$IMAGE_VERSION diff --git a/services/bookstack/start.sh b/services/bookstack/start.sh index ed64838..cca42fd 100644 --- a/services/bookstack/start.sh +++ b/services/bookstack/start.sh @@ -2,21 +2,19 @@ source constants.sh -podman network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists" - podman run \ --detach \ - --network $NETWORK_NAME \ + --pod services \ --name $DB_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/bookstack-db.env \ --mount type=bind,source=$APP_DATA_DIR/bookstack-db,target=/var/lib/mysql \ - $DB_IMAGE_NAME:$IMAGE_VERSION + mariadb:10.6 \ + --port 3307 podman run \ --detach \ - --network $NETWORK_NAME \ + --pod services \ --name $APP_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/bookstack-app.env \ - --publish 6875:80 \ --mount type=bind,source=$APP_DATA_DIR/bookstack-app,target=/config \ $APP_IMAGE_NAME:$IMAGE_VERSION diff --git a/services/deluge/start.sh b/services/deluge/start.sh index eadcbd7..92408e2 100644 --- a/services/deluge/start.sh +++ b/services/deluge/start.sh @@ -2,16 +2,11 @@ source constants.sh -podman network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists" - podman run \ --detach \ - --network $NETWORK_NAME \ + --pod services \ --name $APP_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/deluge.env \ - --publish 8112:8112 \ - --publish 6881:6881/udp \ - --publish 6881:6881/tcp \ --mount type=bind,source=$APP_DATA_DIR/deluge/config,target=/config \ --mount type=bind,source=$APP_DATA_DIR/deluge/downloads,target=/downloads \ --mount type=bind,source=$STORAGE_DIR,target=/complete \ diff --git a/services/plex/start.sh b/services/plex/start.sh index 5929724..ba8a74f 100644 --- a/services/plex/start.sh +++ b/services/plex/start.sh @@ -2,11 +2,8 @@ source constants.sh -podman network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists" - podman run \ --detach \ - --network $NETWORK_NAME \ --name $APP_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/plex.env \ --publish 32401:32400 \