From 1770d26badd3ec1b5e29134da1d91fb50d192b9d Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sun, 31 Mar 2024 15:02:18 -0400 Subject: [PATCH] refactor(bitwarden): extract into own pod --- services/bitwarden/start.sh | 35 +++++++++++++++++++++-------------- services/bitwarden/stop.sh | 5 +---- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/services/bitwarden/start.sh b/services/bitwarden/start.sh index 02d5c04..df3c86a 100644 --- a/services/bitwarden/start.sh +++ b/services/bitwarden/start.sh @@ -2,19 +2,26 @@ source constants.sh -podman run \ - --detach \ - --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 \ - $DB_IMAGE_NAME:$IMAGE_VERSION +podman pod create \ + -p 8080:8080 \ + --replace \ + "bitwarden" podman run \ - --detach \ - --pod services \ - --name $APP_CONTAINER_NAME \ - --env-file $ENV_FILE_DIR/bitwarden-web.env \ - --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 + -d \ + --pod "bitwarden" \ + --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 \ + --replace \ + "$DB_IMAGE_NAME:$IMAGE_VERSION" + +podman run \ + -d \ + --pod "bitwarden" \ + --name "$APP_CONTAINER_NAME" \ + --env-file "$ENV_FILE_DIR"/bitwarden-web.env \ + --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 \ + --replace \ + "$APP_IMAGE_NAME:$IMAGE_VERSION" diff --git a/services/bitwarden/stop.sh b/services/bitwarden/stop.sh index ea7d565..18cac5b 100644 --- a/services/bitwarden/stop.sh +++ b/services/bitwarden/stop.sh @@ -1,6 +1,3 @@ #!/bin/bash -source constants.sh - -podman rm -f $APP_CONTAINER_NAME -podman rm -f $DB_CONTAINER_NAME +podman pod stop "bitwarden"