Remove Docker Compose version from YML files and set networks to external

The Docker Compose version definition was removed from traefikContainer, portainerContainer, and opensshContainer functions. The "external" attribute was also added to "traefik" and "openssh" networks. These changes aim to improve the versatility and compatibility of network settings and remove unnecessary version constraints.
This commit is contained in:
Llewellyn van der Merwe 2024-06-01 15:11:16 +02:00
parent eaa5b217c8
commit e627e7f4cd
Signed by: Llewellyn
GPG Key ID: A9201372263741E7

View File

@ -262,15 +262,13 @@ function traefik__TRuST__setup() {
function traefikContainer() { function traefikContainer() {
# we build the yml file # we build the yml file
cat <<EOF cat <<EOF
version: "3.3"
services: services:
traefik: traefik:
container_name: traefik container_name: traefik
image: "traefik:latest" image: "traefik:latest"
command: command:
${VDM_REMOVE_SECURE} - --entrypoints.web.address=:80 - --entrypoints.web.address=:80
${VDM_REMOVE_SECURE} - --entrypoints.websecure.address=:443 - --entrypoints.websecure.address=:443
# - --api.dashboard=true # - --api.dashboard=true
# - --api.insecure=true # - --api.insecure=true
- --providers.docker - --providers.docker
@ -303,6 +301,7 @@ ${VDM_REMOVE_SECURE} - "traefik.http.middlewares.redirect-to-me.redirectsch
networks: networks:
traefik: traefik:
external: true
name: ${VDM_TRAEFIK_GATEWAY:-traefik_webgateway} name: ${VDM_TRAEFIK_GATEWAY:-traefik_webgateway}
EOF EOF
} }
@ -376,8 +375,6 @@ function portainer__TRuST__setup() {
function portainerContainer() { function portainerContainer() {
# we build the yml file # we build the yml file
cat <<EOF cat <<EOF
version: "3.3"
services: services:
portainer: portainer:
image: portainer/portainer-ce:latest image: portainer/portainer-ce:latest
@ -732,7 +729,6 @@ function joomlaContainer() {
fi fi
# we build the yml file # we build the yml file
cat <<EOF cat <<EOF
version: '2'
services: services:
mariadb${VDM_KEY}: mariadb${VDM_KEY}:
image: mariadb:latest image: mariadb:latest
@ -1317,7 +1313,6 @@ function openssh__TRuST__setup() {
function opensshContainer() { function opensshContainer() {
# we build the yml file # we build the yml file
cat <<EOF cat <<EOF
version: "2.1"
services: services:
openssh-server-${VDM_KEY}: openssh-server-${VDM_KEY}:
image: lscr.io/linuxserver/openssh-server image: lscr.io/linuxserver/openssh-server
@ -1339,6 +1334,7 @@ services:
networks: networks:
openssh: openssh:
external: true
name: ${VDM_OPENSSH_GATEWAY:-openssh_gateway} name: ${VDM_OPENSSH_GATEWAY:-openssh_gateway}
EOF EOF
} }