Moved commands to docker-compose and created base directories for each service
This commit is contained in:
parent
859d1e7920
commit
9f78abfd9d
12 changed files with 130 additions and 0 deletions
19
nextcloud/docker-compose.yml
Normal file
19
nextcloud/docker-compose.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
version: '3'
|
||||
services:
|
||||
nextcloud:
|
||||
sig-proxy: false
|
||||
image: nextcloud/all-in-one:latest
|
||||
container_name: nextcloud-aio-mastercontainer
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- TZ=America/Los_Angeles
|
||||
- NEXTCLOUD_DATADIR=${ZFS_DIR}/nextcloud/data
|
||||
- NEXTCLOUD_MOUNT=${ZFS_DIR}/nextcloud
|
||||
- APACHE_PORT=${APACHE_PORT}
|
||||
- APACHE_IP_BINDING=${APACHE_COMM}
|
||||
- NEXTCLOUD_MEMORY_LIMIT=${AIO_MEM}M
|
||||
volumes:
|
||||
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
restart: unless-stopped
|
||||
58
nextcloud/nextcloud_install.sh
Executable file
58
nextcloud/nextcloud_install.sh
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
## Define admin user account
|
||||
if [ -z "$ADMIN_ACCOUNT"]
|
||||
then
|
||||
ADMIN_ACCOUNT=root
|
||||
fi
|
||||
su - ${ADMIN_ACCOUNT}
|
||||
|
||||
## Define bulk storage location
|
||||
if [ -z "$ZFS_DIR" ]
|
||||
then
|
||||
ZFS_DIR=/data
|
||||
fi
|
||||
|
||||
echo "Installing Nextcloud AIO ..."
|
||||
|
||||
if [ -z "$APACHE_COMM" ]
|
||||
then
|
||||
./create_reverse_proxy.sh
|
||||
fi
|
||||
|
||||
if [ -z "$SYS_MEM" ]
|
||||
then
|
||||
SYS_MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||
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"
|
||||
NEXTCLD_EXTERN_HTTP=12080
|
||||
NEXTCLD_EXTERN_HTTPS=12443
|
||||
APACHE_COMM=127.0.0.1
|
||||
APACHE_PORT=${NEXTCLD_EXTERN_HTTPS}
|
||||
|
||||
sudo docker run -d \
|
||||
--sig-proxy=false \
|
||||
--name nextcloud-aio-mastercontainer \
|
||||
--restart always \
|
||||
--publish 8080:8080 \
|
||||
--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
|
||||
# --publish ${NEXTCLD_EXTERN_HTTP}:80 \
|
||||
# --publish ${NEXTCLD_EXTERN_HTTPS}:8443 \
|
||||
|
||||
echo "Successfully installed Nextcloud AIO"
|
||||
Loading…
Add table
Add a link
Reference in a new issue