Cleaned up a few docker configs

This commit is contained in:
root 2025-01-22 16:52:47 +00:00
parent d1797b8242
commit ef7aa2b31a
7 changed files with 15 additions and 28 deletions

View File

@ -5,15 +5,13 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_element() { config_element() {
echo -ne "\n* Configuring /federated/apps/element container.." echo -ne "* Configuring element container.."
if [ ! -d "/federated/apps/element" ]; then if [ ! -d "/federated/apps/element" ]; then
mkdir -p /federated/apps/element/data/element &> /dev/null mkdir -p /federated/apps/element/data/element &> /dev/null
fi fi
cat > /federated/apps/element/docker-compose.yml <<EOF cat > /federated/apps/element/docker-compose.yml <<EOF
version: '3.7'
services: services:
element: element:
image: vectorim/element-web:\${IMAGE_VERSION} image: vectorim/element-web:\${IMAGE_VERSION}
@ -122,11 +120,11 @@ cat > /federated/apps/element/data/element/element-config.json <<EOF
} }
EOF EOF
echo -ne "done." echo -ne "done.\n"
} }
start_element() { start_element() {
# Start service with command to make sure it's up before proceeding # Start service with command to make sure it's up before proceeding
start_service "element" "nc -z 192.168.0.20 80 &> /dev/null" "7" start_service "element" "nc -z 192.168.0.20 80 &> /dev/null" "7"
echo -ne "done." echo -ne "done.\n"
} }

View File

@ -5,7 +5,7 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_ldap() { config_ldap() {
echo -ne "\n* Configuring /federated/apps/ldap container.." echo -ne "* Configuring ldap container.."
if [ ! -d "/federated/apps/ldap" ]; then if [ ! -d "/federated/apps/ldap" ]; then
mkdir -p /federated/apps/ldap/data/certs &> /dev/null mkdir -p /federated/apps/ldap/data/certs &> /dev/null
@ -19,8 +19,6 @@ config_ldap() {
LDAPFCOREPASS=`echo -n $ADMINPASS | openssl dgst -sha1 -binary | openssl enc -base64 | awk '{print "{SHA}"$0}'` LDAPFCOREPASS=`echo -n $ADMINPASS | openssl dgst -sha1 -binary | openssl enc -base64 | awk '{print "{SHA}"$0}'`
cat > /federated/apps/ldap/docker-compose.yml <<EOF cat > /federated/apps/ldap/docker-compose.yml <<EOF
version: '3.7'
services: services:
ldap: ldap:
image: osixia/openldap:\${IMAGE_VERSION} image: osixia/openldap:\${IMAGE_VERSION}
@ -175,7 +173,7 @@ EOF
chmod +x /federated/apps/ldap/data/root/ldap.sh chmod +x /federated/apps/ldap/data/root/ldap.sh
echo -ne "done." echo -ne "done.\n"
} }
start_ldap() { start_ldap() {
# Start service with command to make sure it's up before proceeding # Start service with command to make sure it's up before proceeding
@ -186,5 +184,5 @@ start_ldap() {
docker exec ldap /root/ldap.sh &> /dev/null docker exec ldap /root/ldap.sh &> /dev/null
[ $? -ne 0 ] && fail "Couldn't run ldap.sh inside ldap container" [ $? -ne 0 ] && fail "Couldn't run ldap.sh inside ldap container"
echo -ne "done." echo -ne "done.\n"
} }

View File

@ -19,8 +19,6 @@ config_nextcloud() {
get_appvars get_appvars
cat > /federated/apps/nextcloud/docker-compose.yml <<EOF cat > /federated/apps/nextcloud/docker-compose.yml <<EOF
version: '3.7'
services: services:
nextcloud: nextcloud:
image: nextcloud:\${IMAGE_VERSION} image: nextcloud:\${IMAGE_VERSION}

View File

@ -5,15 +5,13 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_panel() { config_panel() {
echo -ne "\n* Configuring /federated/apps/panel container.." echo -ne "* Configuring panel container.."
if [ ! -d "/federated/apps/panel" ]; then if [ ! -d "/federated/apps/panel" ]; then
mkdir -p /federated/apps/panel/data/opt/ldap_user_manager mkdir -p /federated/apps/panel/data/opt/ldap_user_manager
fi fi
cat > /federated/apps/panel/docker-compose.yml <<EOF cat > /federated/apps/panel/docker-compose.yml <<EOF
version: '3.7'
services: services:
panel: panel:
image: wheelybird/ldap-user-manager:\${IMAGE_VERSION} image: wheelybird/ldap-user-manager:\${IMAGE_VERSION}
@ -71,11 +69,11 @@ NO_HTTPS=true
EOF EOF
chmod 600 /federated/apps/panel/.env chmod 600 /federated/apps/panel/.env
echo -ne "done." echo -ne "done.\n"
} }
start_panel() { start_panel() {
# Start service with command to make sure it's up before proceeding # Start service with command to make sure it's up before proceeding
start_service "panel" "nc -z 192.168.0.23 80 &> /dev/null" "7" start_service "panel" "nc -z 192.168.0.23 80 &> /dev/null" "7"
echo -ne "done." echo -ne "done.\n"
} }

View File

@ -5,15 +5,13 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_pdnsadmin() { config_pdnsadmin() {
echo -ne "\n* Configuring /federated/apps/pdnsadmin container.." echo -ne "* Configuring pdnsadmin container.."
if [ ! -d "/federated/apps/pdnsadmin" ]; then if [ ! -d "/federated/apps/pdnsadmin" ]; then
mkdir -p /federated/apps/pdnsadmin/data/etc mkdir -p /federated/apps/pdnsadmin/data/etc
fi fi
cat > /federated/apps/pdnsadmin/docker-compose.yml <<EOF cat > /federated/apps/pdnsadmin/docker-compose.yml <<EOF
version: '3.7'
services: services:
pdnsadmin: pdnsadmin:
image: pschiffe/pdns-admin-uwsgi\${IMAGE_VERSION} image: pschiffe/pdns-admin-uwsgi\${IMAGE_VERSION}
@ -86,7 +84,7 @@ pidfile = /run/uwsgi/%n.pid
enable-threads = true enable-threads = true
EOF EOF
echo -ne "done." echo -ne "done.\n"
} }
start_pdnsadmin() { start_pdnsadmin() {
# Start service with command to make sure it's up before proceeding # Start service with command to make sure it's up before proceeding
@ -95,5 +93,5 @@ start_pdnsadmin() {
# Run MySQL command to create admin user for pdns admin interface # Run MySQL command to create admin user for pdns admin interface
docker exec pdnsmysql bash -c "mysql -updns -p$MYSQL_PASSWORD pdns -e '$PDNS_MYSQL_COMMAND;'" docker exec pdnsmysql bash -c "mysql -updns -p$MYSQL_PASSWORD pdns -e '$PDNS_MYSQL_COMMAND;'"
echo -ne "done." echo -ne "done.\n"
} }

View File

@ -5,15 +5,13 @@
PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
config_pdnsmysql() { config_pdnsmysql() {
echo -ne "\n* Configuring /federated/apps/pdnsmysql container.." echo -ne "* Configuring pdnsmysql container.."
if [ ! -d "/federated/apps/pdnsmysql" ]; then if [ ! -d "/federated/apps/pdnsmysql" ]; then
mkdir -p /federated/apps/pdnsmysql/data/var/lib/mysql mkdir -p /federated/apps/pdnsmysql/data/var/lib/mysql
fi fi
cat > /federated/apps/pdnsmysql/docker-compose.yml <<EOF cat > /federated/apps/pdnsmysql/docker-compose.yml <<EOF
version: '3.7'
services: services:
mysql: mysql:
image: mariadb:\${IMAGE_VERSION} image: mariadb:\${IMAGE_VERSION}
@ -45,11 +43,11 @@ MYSQL_USER=pdns
EOF EOF
chmod 600 /federated/apps/pdnsmysql/.env chmod 600 /federated/apps/pdnsmysql/.env
echo -ne "done." echo -ne "done.\n"
} }
start_pdnsmysql() { start_pdnsmysql() {
# Start service with command to make sure it's up before proceeding # Start service with command to make sure it's up before proceeding
start_service "pdnsmysql" "nc -z 192.168.0.10 3306 &> /dev/null" "8" start_service "pdnsmysql" "nc -z 192.168.0.10 3306 &> /dev/null" "8"
echo -ne "done." echo -ne "done.\n"
} }

View File

@ -13,7 +13,6 @@ config_roundcube() {
fi fi
cat > /federated/apps/roundcube/docker-compose.yml <<EOF cat > /federated/apps/roundcube/docker-compose.yml <<EOF
version: "3.7"
services: services:
roundcube: roundcube:
image: roundcube/roundcubemail:\${IMAGE_VERSION} image: roundcube/roundcubemail:\${IMAGE_VERSION}