From a42690c99bf7279388747faea0e6261b9b3aba77 Mon Sep 17 00:00:00 2001 From: Adam Parler Date: Sun, 9 Jul 2023 16:08:17 -0700 Subject: [PATCH] Created Nextcloud installation script. Could not test because I could not set up reverse proxy correctly. --- nextcloud_install.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 nextcloud_install.sh diff --git a/nextcloud_install.sh b/nextcloud_install.sh new file mode 100755 index 0000000..173a0ab --- /dev/null +++ b/nextcloud_install.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +if [ -z "$ZFS_DIR" ] +then + ZFS_DIR=/data +fi + +if [ -z "$APACHE_COMM" ] +then + ./create_reverse_proxy.sh +fi + +if [ SYS_MEM -gt 2097152 ] +then + let "SYS_MEM = $SYS_MEM - 1048576" +else + let "SYS_MEM = $SYS_MEM / 2" +fi + +echo "Installing Nextcloud AIO ..." +let "AIO_MEM = $SYS_MEM / 1024" + +sudo docker run \ +--sig-proxy=false \ +--name nextcloud-aio-mastercontainer \ +--restart always \ +--publish 11080:80 \ +--publish 8080:8080 \ +--publish 11443:8443 \ +--env NEXTCLOUD_DATADIR=${ZFS_DIR}/nextcloud/data \ +--env NEXTCLOUD_MOUNT=${ZFS_DIR}/nextcloud \ +--env APACHE_PORT=${APACHE_PORT} \ +--env APACHE_IP_BINDING=${APACHE_COMM} \ +--env NEXTCLOUD_MEMORY_LIMIT=${AIO_MEM}M \ +--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ +--volume /var/run/docker.sock:/var/run/docker.sock:ro \ +nextcloud/all-in-one:latest + +echo "Successfully installed Nextcloud AIO"