mirror of
https://github.com/nextcloud/docker.git
synced 2025-04-21 11:06:09 +02:00
fix upgrade process
This commit is contained in:
parent
f69bcf3d1c
commit
3481db03a0
2 changed files with 11 additions and 2 deletions
|
@ -6,7 +6,10 @@ services:
|
|||
command: --transaction-isolation=READ-COMMITTED
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
- /run/mysqld/
|
||||
- /tmp
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
environment:
|
||||
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
|
||||
MYSQL_DATABASE: nextcloud
|
||||
|
@ -17,6 +20,7 @@ services:
|
|||
depends_on:
|
||||
- db
|
||||
image: ${NC_IMAGE_NAME:-nextcloud:latest}
|
||||
read_only: true
|
||||
volumes:
|
||||
- nextcloud_data:/var/www/html/data
|
||||
- nextcloud_apps:/var/www/html/apps
|
||||
|
@ -26,9 +30,10 @@ services:
|
|||
- "8000:80"
|
||||
restart: always
|
||||
environment:
|
||||
NEXTCLOUD_ADMIN_USER: adminstrator
|
||||
NEXTCLOUD_ADMIN_USER: administrator
|
||||
NEXTCLOUD_ADMIN_PASSWORD: adminpass
|
||||
NEXTCLOUD_TRUSTED_DOMAINS: localhost
|
||||
### Commented out as this will make the entrypoint assume that a clean install is appropriate
|
||||
MYSQL_DATABASE: nextcloud
|
||||
MYSQL_PASSWORD: nextcloud
|
||||
MYSQL_USER: nextcloud
|
||||
|
|
|
@ -79,6 +79,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
|
||||
installed_version="0.0.0.0"
|
||||
# shellcheck disable=SC2016
|
||||
if [ -f /var/www/html/config/version.php ];then
|
||||
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
|
||||
fi
|
||||
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||
|
||||
if version_greater "$installed_version" "$image_version"; then
|
||||
|
@ -175,14 +178,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
fi
|
||||
#upgrade
|
||||
else
|
||||
chown -R www-data:root /var/www/html/apps /var/www/html/custom_apps /var/www/html/data
|
||||
run_as 'php /var/www/html/occ upgrade'
|
||||
|
||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||
echo "The following apps have been disabled:"
|
||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||
rm -f /tmp/list_before /tmp/list_after
|
||||
|
||||
fi
|
||||
cp /var/www/html/version.php /var/www/html/config/version.php
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue