Update docker compose syntax, move slskd to media stack

This commit is contained in:
mr-vercetti 2025-02-10 22:32:08 +01:00
parent 5fcb61e4c9
commit b6d21c2c22
9 changed files with 44 additions and 41 deletions

View File

@ -13,24 +13,27 @@ case "$command" in
"up")
for stack in "$BASE_DIR"/stacks/*/*
do
docker-compose -f "${stack}" --env-file "$BASE_DIR/.env" up -d
docker compose -f "${stack}" --env-file "$BASE_DIR/.env" up -d
done
;;
"stop" | "restart")
for stack in "$BASE_DIR"/stacks/*/*
do
docker-compose -f "${stack}" --env-file "$BASE_DIR/.env" $command
docker compose -f "${stack}" --env-file "$BASE_DIR/.env" $command
done
;;
"recreate")
if [ $# -lt 3 ]; then
echo "Please provide both the stack name and the service to recreate"
"recreate")
if [ $# -eq 2 ]; then
stack_name="$2"
service_name="$2"
elif [ $# -eq 3 ]; then
stack_name="$2"
service_name="$3"
else
echo "Usage: $0 recreate <stack_name> <service_name>"
exit 1
fi
stack_name="$2"
service="$3"
stack_file="$BASE_DIR/stacks/${stack_name}/${stack_name}.yml"
if [ ! -f "$stack_file" ]; then
@ -38,9 +41,9 @@ case "$command" in
exit 1
fi
docker-compose -f "${stack_file}" --env-file "$BASE_DIR/.env" stop "$service"
docker-compose -f "${stack_file}" --env-file "$BASE_DIR/.env" rm -f "$service"
docker-compose -f "${stack_file}" --env-file "$BASE_DIR/.env" up -d "$service"
docker compose -f ${stack_file} --env-file "$BASE_DIR/.env" stop ${service_name}
docker compose -f ${stack_file} --env-file "$BASE_DIR/.env" rm -f ${service_name}
docker compose -f ${stack_file} --env-file "$BASE_DIR/.env" up -d ${service_name}
;;
*)
echo "Wrong command. Please use 'up', 'stop', 'restart', or 'recreate'"

View File

@ -22,7 +22,7 @@ services:
networks:
proxy:
external:
name: proxy
name: proxy
external: true
bitwarden:
name: bitwarden

View File

@ -16,7 +16,7 @@ services:
networks:
proxy:
external:
name: proxy
name: proxy
external: true
collabora:
name: collabora

View File

@ -165,9 +165,26 @@ services:
- "8998:17442"
restart: unless-stopped
slskd:
image: slskd/slskd
container_name: slskd
user: ${PUID}:${PGID}
environment:
- TZ=${TIMEZONE}
- SLSKD_REMOTE_FILE_MANAGEMENT=true
- SLSKD_SLSK_USERNAME=${SLSKD_SLSK_USERNAME}
- SLSKD_SLSK_PASSWORD=${SLSKD_SLSK_PASSWORD}
- SLSKD_SHARED_DIR=/app/downloads
network_mode: "container:gluetun"
volumes:
- ${APPS_DIR}/slskd:/app/data
- ${DATA_DIR}/downloads/slskd/incomplete:/app/incomplete
- ${DATA_DIR}/media/music:/app/downloads
restart: unless-stopped
networks:
proxy:
external:
name: proxy
name: proxy
external: true
media:
name: media

View File

@ -9,7 +9,7 @@ services:
networks:
proxy:
external:
name: proxy
name: proxy
external: true
mrvercetticc:
name: mrvercetticc

View File

@ -52,7 +52,7 @@ services:
networks:
proxy:
external:
name: proxy
name: proxy
external: true
nextcloud:
name: nextcloud

View File

@ -1,17 +0,0 @@
services:
slskd:
image: slskd/slskd
container_name: slskd
user: ${PUID}:${PGID}
environment:
- TZ=${TIMEZONE}
- SLSKD_REMOTE_FILE_MANAGEMENT=true
- SLSKD_SLSK_USERNAME=${SLSKD_SLSK_USERNAME}
- SLSKD_SLSK_PASSWORD=${SLSKD_SLSK_PASSWORD}
- SLSKD_SHARED_DIR=/app/downloads
network_mode: "container:gluetun"
volumes:
- ${APPS_DIR}/slskd:/app/data
- ${DATA_DIR}/downloads/slskd/incomplete:/app/incomplete
- ${DATA_DIR}/media/music:/app/downloads
restart: unless-stopped

View File

@ -87,7 +87,7 @@ services:
networks:
proxy:
external:
name: proxy
name: proxy
external: true
softdev:
name: softdev

View File

@ -11,7 +11,7 @@ services:
networks:
proxy:
external:
name: proxy
name: proxy
external: true
widmocc:
name: widmocc