This commit is contained in:
2026-02-03 22:20:03 -03:00
parent aea93418c5
commit db298babfc
14 changed files with 672 additions and 0 deletions

40
commands/03-start-nextcloud.sh Executable file
View File

@@ -0,0 +1,40 @@
#! /bin/bash
source .env
# Create container directories
nc_app=${APPS_VOLUME}/nextcloud
nc_data=${STORAGE_VOLUME}/nextcloud
for p in "${nc_app} ${nc_data}"; do
if ! ls ${p} >/dev/null 2>&1; then
echo "Creating ${p} directory..."
mkdir -p ${p}
else
echo "directory exists ${p}"
fi
done
podman run -d --replace \
--name nextcloud_server \
--hostname nextcloud_server \
--restart=always \
--network container-bridge \
--tz=local \
-p ${NEXTCLOUD_PORT}:80 \
-e NEXTCLOUD_ADMIN_USER=${ADMIN_USERNAME} \
-e NEXTCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD} \
-e NEXTCLOUD_TRUSTED_DOMAINS="cloud.${DOMAIN_NAME} ${LOCAL_IP} ${PUBLIC_IP}" \
-e TRUSTED_PROXIES=proxy_server \
-e TRUSTED_PROXIES=${LOCAL_IP}:${HTTPS_PORT} \
-e OVERWRITECLIURL=https://cloud.${DOMAIN_NAME} \
-e SQLITE_DATABASE=nextcloud_db \
-e REDIS_HOST=redis \
-e PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT} \
-e PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT} \
-v ${nc_app}:/var/www/html \
-v ${nc_data}:/var/www/html/data \
--health-interval=30s \
--health-timeout=10s \
--health-retries=5 \
--health-cmd="curl -f ${LOCAL_IP}:${NEXTCLOUD_PORT}" \
docker.io/nextcloud:${NEXTCLOUD_VERSION}