From 2ef50df0731f1200e1a044df8c2462c97843ff6d Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Fri, 15 Dec 2023 15:32:14 -0500 Subject: [PATCH] feat(deluge): move Deluge setup to task model fix: image filename deluge --- .../Dockerfile-deluge-app} | 0 services/deluge/build.sh | 5 +++++ services/deluge/constants.sh | 6 ++++++ services/deluge/start.sh | 18 ++++++++++++++++++ services/deluge/stop.sh | 5 +++++ 5 files changed, 34 insertions(+) rename services/{Dockerfile-deluge => deluge/Dockerfile-deluge-app} (100%) create mode 100644 services/deluge/build.sh create mode 100644 services/deluge/constants.sh create mode 100644 services/deluge/start.sh create mode 100644 services/deluge/stop.sh diff --git a/services/Dockerfile-deluge b/services/deluge/Dockerfile-deluge-app similarity index 100% rename from services/Dockerfile-deluge rename to services/deluge/Dockerfile-deluge-app diff --git a/services/deluge/build.sh b/services/deluge/build.sh new file mode 100644 index 0000000..d2adb1b --- /dev/null +++ b/services/deluge/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source constants.sh + +docker build -t $APP_IMAGE_NAME:dev -f Dockerfile-deluge-app . diff --git a/services/deluge/constants.sh b/services/deluge/constants.sh new file mode 100644 index 0000000..e68981f --- /dev/null +++ b/services/deluge/constants.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export APP_NAME="deluge" +export APP_CONTAINER_NAME=$APP_NAME-app +export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME +export NETWORK_NAME=$APP_NAME-local diff --git a/services/deluge/start.sh b/services/deluge/start.sh new file mode 100644 index 0000000..69b05e6 --- /dev/null +++ b/services/deluge/start.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +source constants.sh + +docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists" + +docker run \ + --detach \ + --network $NETWORK_NAME \ + --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 \ + $APP_IMAGE_NAME:dev diff --git a/services/deluge/stop.sh b/services/deluge/stop.sh new file mode 100644 index 0000000..871ff06 --- /dev/null +++ b/services/deluge/stop.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source constants.sh + +docker rm -f $APP_CONTAINER_NAME