Skip to content

Commit 7751ed0

Browse files
committed
add volumes management from template
1 parent cb3e1b0 commit 7751ed0

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.templates/transmission/volumes.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
transm_download_volume:
3+
driver: local
4+
driver_opts:
5+
o: bind
6+
type: none
7+
device: <transm_download_volume absolute path on disk>
8+
9+
transm_watch_volume:
10+
driver: local
11+
driver_opts:
12+
o: bind
13+
type: none
14+
device: <transm_watch_volume absolute path on disk>
15+
16+
transm_config_volume:
17+
driver: local
18+
driver_opts:
19+
o: bind
20+
type: none
21+
device: <transm_config_volume absolute path on disk>

menu.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ function yml_builder() {
117117
#if an env file exists check for timezone
118118
[ -f "./services/$1/$1.env" ] && timezones ./services/$1/$1.env
119119

120+
# if a volumes.yml exists, append to overall volumes.yml file
121+
[ -f "./services/$1/volumes.yml" ] && cat "./services/$1/volumes.yml" >> docker-volumes.yml
122+
120123
#add new line then append service
121124
echo "" >>docker-compose.yml
122125
cat $service >>docker-compose.yml
@@ -260,6 +263,14 @@ case $mainmenu_selection in
260263
done
261264
fi
262265
fi
266+
267+
# if a container needs volume, put it at the end of docker-compose
268+
if [ -f docker-volumes.yml ]; then
269+
echo "" >> docker-compose.yml
270+
echo "volumes:" >> docker-compose.yml
271+
cat docker-volumes.yml >> docker-compose.yml
272+
rm docker-volumes.yml
273+
fi
263274

264275
echo "docker-compose successfully created"
265276
echo "run 'docker-compose up -d' to start the stack"

0 commit comments

Comments
 (0)