mirror of
https://github.com/nextcloud/docker.git
synced 2025-07-18 13:38:05 +02:00
Compare commits
43 commits
e35ea1e23b
...
1bfb7357af
Author | SHA1 | Date | |
---|---|---|---|
|
1bfb7357af | ||
|
49e139cc2c | ||
|
547a09d611 | ||
|
3aed7a1705 | ||
|
bb0354f587 | ||
|
a19d68f081 | ||
|
f130178136 | ||
|
f3e0c49c38 | ||
|
b36cfa65da | ||
|
6e8f484c4b | ||
|
43311addf2 | ||
|
558ff494d3 | ||
|
7832770350 | ||
|
a2995dde03 | ||
|
88ef913597 | ||
|
abd0ba3fdb | ||
|
7da5fa1c6b | ||
|
3adaf30839 | ||
|
c76fb1dc57 | ||
|
e56b9a4e2e | ||
|
16727bbbde | ||
|
df3b447621 | ||
|
c351ce76ab | ||
|
73949fe23a | ||
|
86ab9d769c | ||
|
5be2a020e0 | ||
|
af00599148 | ||
|
71235584cd | ||
|
4daafc8d20 | ||
|
4f691770ae | ||
|
a5656577ef | ||
|
69c1e4a000 | ||
|
877ddb49dd | ||
|
2f38386c50 | ||
|
98a9617352 | ||
|
9ca82128a7 | ||
|
8d2e9048bc | ||
|
616d0dff03 | ||
|
a43854ae5c | ||
|
e0294b65ac | ||
|
7f707b6c5d | ||
|
5b932e390e | ||
|
08ac24880c |
79 changed files with 734 additions and 320 deletions
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,15 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
|
||||||
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
|
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
|
||||||
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
|
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
|
||||||
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
|
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
|
||||||
|
$proxy = getenv('OBJECTSTORE_S3_PROXY');
|
||||||
|
$verify_bucket_exists = getenv('OBJECTSTORE_S3_VERIFY_BUCKET_EXISTS');
|
||||||
|
$use_multipart_copy = getenv('OBJECTSTORE_S3_USEMULTIPARTCOPY');
|
||||||
|
$concurrency = getenv('OBJECTSTORE_S3_CONCURRENCY');
|
||||||
|
$timeout = getenv('OBJECTSTORE_S3_TIMEOUT');
|
||||||
|
$upload_part_size = getenv('OBJECTSTORE_S3_UPLOADPARTSIZE');
|
||||||
|
$put_size_limit = getenv('OBJECTSTORE_S3_PUTSIZELIMIT');
|
||||||
|
$copy_size_limit = getenv('OBJECTSTORE_S3_COPYSIZELIMIT');
|
||||||
|
|
||||||
$CONFIG = array(
|
$CONFIG = array(
|
||||||
'objectstore' => array(
|
'objectstore' => array(
|
||||||
'class' => '\OC\Files\ObjectStore\S3',
|
'class' => '\OC\Files\ObjectStore\S3',
|
||||||
|
@ -19,11 +28,35 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
|
||||||
// required for some non Amazon S3 implementations
|
// required for some non Amazon S3 implementations
|
||||||
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
|
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
|
||||||
// required for older protocol versions
|
// required for older protocol versions
|
||||||
'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false'
|
'useMultipartCopy' => strtolower($useMultipartCopy) !== 'true',
|
||||||
|
'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false',
|
||||||
|
'proxy' => strtolower($proxy) !== 'false',
|
||||||
|
'version' => getenv('OBJECTSTORE_S3_VERSION') ?: 'latest',
|
||||||
|
'verify_bucket_exists' => strtolower($verify_bucket_exists) !== 'true'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if $concurrency {
|
||||||
|
$CONFIG['objectstore']['arguments']['concurrency'] = $concurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
if $timeout {
|
||||||
|
$CONFIG['objectstore']['arguments']['timeout'] = $timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
if $upload_part_size {
|
||||||
|
$CONFIG['objectstore']['arguments']['uploadPartSize'] = $upload_part_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
if $put_size_limit {
|
||||||
|
$CONFIG['objectstore']['arguments']['putSizeLimit'] = $put_size_limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if $copy_size_limit {
|
||||||
|
$CONFIG['objectstore']['arguments']['copySizeLimit'] = $copy_size_limit;
|
||||||
|
}
|
||||||
|
|
||||||
if (getenv('OBJECTSTORE_S3_KEY_FILE')) {
|
if (getenv('OBJECTSTORE_S3_KEY_FILE')) {
|
||||||
$CONFIG['objectstore']['arguments']['key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_KEY_FILE')));
|
$CONFIG['objectstore']['arguments']['key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_KEY_FILE')));
|
||||||
} elseif (getenv('OBJECTSTORE_S3_KEY')) {
|
} elseif (getenv('OBJECTSTORE_S3_KEY')) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.11
|
image: mariadb:10.11
|
||||||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql:Z
|
- db:/var/lib/mysql:Z
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.11
|
image: mariadb:10.11
|
||||||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql:Z
|
- db:/var/lib/mysql:Z
|
||||||
|
|
|
@ -183,7 +183,7 @@ http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.woff2?$ {
|
location ~ \.(otf|woff2?)$ {
|
||||||
try_files $uri /index.php$request_uri;
|
try_files $uri /index.php$request_uri;
|
||||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||||
access_log off; # Optional: Don't log access to assets
|
access_log off; # Optional: Don't log access to assets
|
||||||
|
|
|
@ -183,7 +183,7 @@ http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.woff2?$ {
|
location ~ \.(otf|woff2?)$ {
|
||||||
try_files $uri /index.php$request_uri;
|
try_files $uri /index.php$request_uri;
|
||||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||||
access_log off; # Optional: Don't log access to assets
|
access_log off; # Optional: Don't log access to assets
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.11
|
image: mariadb:10.11
|
||||||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql:Z
|
- db:/var/lib/mysql:Z
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.11
|
image: mariadb:10.11
|
||||||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql:Z
|
- db:/var/lib/mysql:Z
|
||||||
|
|
|
@ -183,7 +183,7 @@ http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.woff2?$ {
|
location ~ \.(otf|woff2?)$ {
|
||||||
try_files $uri /index.php$request_uri;
|
try_files $uri /index.php$request_uri;
|
||||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||||
access_log off; # Optional: Don't log access to assets
|
access_log off; # Optional: Don't log access to assets
|
||||||
|
|
|
@ -183,7 +183,7 @@ http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.woff2?$ {
|
location ~ \.(otf|woff2?)$ {
|
||||||
try_files $uri /index.php$request_uri;
|
try_files $uri /index.php$request_uri;
|
||||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||||
access_log off; # Optional: Don't log access to assets
|
access_log off; # Optional: Don't log access to assets
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
name: 🐛 Image issue
|
name: 🐛 Report a bug in the image
|
||||||
about: Issues related to the Nextcloud Docker image
|
about: Create a report to help us improve the image
|
||||||
|
labels: "bug, 0. Needs triage"
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!--
|
15
.github/ISSUE_TEMPLATE/02-Image_enhancement
vendored
Normal file
15
.github/ISSUE_TEMPLATE/02-Image_enhancement
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
name: 🚀 Suggest an enhancement
|
||||||
|
about: Suggest an idea for improving the image
|
||||||
|
labels: "enhancement, 0. Needs triage"
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Thanks for suggesting an idea to improve the Nextcloud Docker image!
|
||||||
|
|
||||||
|
This image is maintained by volunteers so if you're able to assist with implementing your idea, please mention that (and consider submitting a PR as well).
|
||||||
|
|
||||||
|
Note: This is the issue tracker of the official Nextcloud **Docker image**, please do NOT use this to suggestion enhancements in Nextcloud Server itself.
|
||||||
|
|
||||||
|
To learn more about official images, see https://github.com/docker-library/faq
|
||||||
|
-->
|
28
.github/ISSUE_TEMPLATE/config.yml
vendored
28
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -1,10 +1,22 @@
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: 🐛 Nextcloud issue
|
- name: ❓ Ask a question
|
||||||
url: https://github.com/nextcloud/server/issues/new/choose
|
|
||||||
about: Bug reports and feature requests for Nextcloud
|
|
||||||
- name: 🐳 Docker Support and Help
|
|
||||||
url: https://forums.docker.com/
|
|
||||||
about: Configuration, installation, networking and other questions
|
|
||||||
- name: ❓ Nextcloud Support and Help
|
|
||||||
url: https://help.nextcloud.com/
|
url: https://help.nextcloud.com/
|
||||||
about: Configuration, webserver/proxy or performance issues and other questions
|
about: Ask a question, get assistance or start a discussion regarding Nextcloud and/or this image
|
||||||
|
- name: Documentation - Nextcloud Server
|
||||||
|
url: https://docs.nextcloud.com/
|
||||||
|
about: Official documentation for Nextcloud Server
|
||||||
|
- name: Documentation - Nextcloud Docker Image
|
||||||
|
url: https://github.com/nextcloud/docker/blob/master/README.md
|
||||||
|
about: Official documentation for this image
|
||||||
|
- name: 🐳 Documentation - Docker
|
||||||
|
url: https://docs.docker.com/
|
||||||
|
about: Official documentation for Docker (installing, configuring, troubleshooting)
|
||||||
|
- name: 🐳 Docker Forum
|
||||||
|
url: https://forums.docker.com/
|
||||||
|
about: Ask a question, get assistance or start a discussion regarding Docker
|
||||||
|
- name: 🐛 Bug Report - Nextcloud Server
|
||||||
|
url: https://github.com/nextcloud/server/issues/new/choose
|
||||||
|
about: Report a bug in Nextcloud Server
|
||||||
|
- name: Enhancement Idea - Nextcloud Server
|
||||||
|
url: https://github.com/nextcloud/server/issues/new/choose
|
||||||
|
about: Suggest an enhancement idea for Nextcloud Server
|
||||||
|
|
|
@ -21,6 +21,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -66,12 +67,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -98,15 +103,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -140,7 +150,7 @@ RUN { \
|
||||||
} > /etc/apache2/conf-available/apache-limits.conf; \
|
} > /etc/apache2/conf-available/apache-limits.conf; \
|
||||||
a2enconf apache-limits
|
a2enconf apache-limits
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 29.0.10
|
ENV NEXTCLOUD_VERSION 29.0.16
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -150,8 +160,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
||||||
FROM php:8.2-fpm-alpine3.20
|
FROM php:8.2-fpm-alpine3.21
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -64,12 +64,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -89,19 +93,25 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN { \
|
RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -120,7 +130,7 @@ RUN { \
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 29.0.10
|
ENV NEXTCLOUD_VERSION 29.0.16
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk add --no-cache --virtual .fetch-deps \
|
apk add --no-cache --virtual .fetch-deps \
|
||||||
|
@ -128,8 +138,8 @@ RUN set -ex; \
|
||||||
gnupg \
|
gnupg \
|
||||||
; \
|
; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -21,6 +21,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -66,12 +67,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -98,15 +103,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -125,7 +135,7 @@ RUN { \
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 29.0.10
|
ENV NEXTCLOUD_VERSION 29.0.16
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -135,8 +145,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -21,6 +21,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -66,12 +67,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -98,15 +103,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -140,7 +150,7 @@ RUN { \
|
||||||
} > /etc/apache2/conf-available/apache-limits.conf; \
|
} > /etc/apache2/conf-available/apache-limits.conf; \
|
||||||
a2enconf apache-limits
|
a2enconf apache-limits
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 30.0.4
|
ENV NEXTCLOUD_VERSION 30.0.10
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -150,8 +160,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
||||||
FROM php:8.2-fpm-alpine3.20
|
FROM php:8.2-fpm-alpine3.21
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -64,12 +64,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -89,19 +93,25 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN { \
|
RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -120,7 +130,7 @@ RUN { \
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 30.0.4
|
ENV NEXTCLOUD_VERSION 30.0.10
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk add --no-cache --virtual .fetch-deps \
|
apk add --no-cache --virtual .fetch-deps \
|
||||||
|
@ -128,8 +138,8 @@ RUN set -ex; \
|
||||||
gnupg \
|
gnupg \
|
||||||
; \
|
; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -21,6 +21,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -66,12 +67,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -98,15 +103,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -125,7 +135,7 @@ RUN { \
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 30.0.4
|
ENV NEXTCLOUD_VERSION 30.0.10
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -135,8 +145,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -21,6 +21,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -66,12 +67,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -98,15 +103,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -140,7 +150,7 @@ RUN { \
|
||||||
} > /etc/apache2/conf-available/apache-limits.conf; \
|
} > /etc/apache2/conf-available/apache-limits.conf; \
|
||||||
a2enconf apache-limits
|
a2enconf apache-limits
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 28.0.14
|
ENV NEXTCLOUD_VERSION 31.0.4
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -150,8 +160,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
|
@ -1,5 +1,5 @@
|
||||||
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
||||||
FROM php:8.2-fpm-alpine3.20
|
FROM php:8.2-fpm-alpine3.21
|
||||||
|
|
||||||
# entrypoint.sh and cron.sh dependencies
|
# entrypoint.sh and cron.sh dependencies
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
@ -64,12 +64,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -89,19 +93,25 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN { \
|
RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -120,7 +130,7 @@ RUN { \
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 28.0.14
|
ENV NEXTCLOUD_VERSION 31.0.4
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk add --no-cache --virtual .fetch-deps \
|
apk add --no-cache --virtual .fetch-deps \
|
||||||
|
@ -128,8 +138,8 @@ RUN set -ex; \
|
||||||
gnupg \
|
gnupg \
|
||||||
; \
|
; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
|
@ -21,6 +21,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -66,12 +67,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.24; \
|
pecl install APCu-5.1.24; \
|
||||||
pecl install imagick-3.7.0; \
|
pecl install igbinary-3.2.16; \
|
||||||
pecl install memcached-3.3.0; \
|
pecl install imagick-3.8.0; \
|
||||||
pecl install redis-6.1.0; \
|
pecl install memcached-3.3.0 \
|
||||||
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-6.2.0 \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -98,15 +103,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
@ -125,7 +135,7 @@ RUN { \
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 28.0.14
|
ENV NEXTCLOUD_VERSION 31.0.4
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -135,8 +145,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
|
@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) {
|
||||||
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
$CONFIG['redis']['port'] = 6379;
|
$CONFIG['redis']['port'] = 6379;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_USER') !== false) {
|
||||||
|
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
|
@ -63,12 +63,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-%%APCU_VERSION%%; \
|
pecl install APCu-%%APCU_VERSION%%; \
|
||||||
|
pecl install igbinary-%%IGBINARY_VERSION%%; \
|
||||||
pecl install imagick-%%IMAGICK_VERSION%%; \
|
pecl install imagick-%%IMAGICK_VERSION%%; \
|
||||||
pecl install memcached-%%MEMCACHED_VERSION%%; \
|
pecl install memcached-%%MEMCACHED_VERSION%% \
|
||||||
pecl install redis-%%REDIS_VERSION%%; \
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-%%REDIS_VERSION%% \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -88,19 +92,25 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN { \
|
RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
|
|
@ -20,6 +20,7 @@ RUN set -ex; \
|
||||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
ENV PHP_MEMORY_LIMIT 512M
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
ENV PHP_UPLOAD_LIMIT 512M
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
\
|
\
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
@ -65,12 +66,16 @@ RUN set -ex; \
|
||||||
\
|
\
|
||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-%%APCU_VERSION%%; \
|
pecl install APCu-%%APCU_VERSION%%; \
|
||||||
|
pecl install igbinary-%%IGBINARY_VERSION%%; \
|
||||||
pecl install imagick-%%IMAGICK_VERSION%%; \
|
pecl install imagick-%%IMAGICK_VERSION%%; \
|
||||||
pecl install memcached-%%MEMCACHED_VERSION%%; \
|
pecl install memcached-%%MEMCACHED_VERSION%% \
|
||||||
pecl install redis-%%REDIS_VERSION%%; \
|
--configureoptions 'enable-memcached-igbinary="yes"'; \
|
||||||
|
pecl install redis-%%REDIS_VERSION%% \
|
||||||
|
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
igbinary \
|
||||||
imagick \
|
imagick \
|
||||||
memcached \
|
memcached \
|
||||||
redis \
|
redis \
|
||||||
|
@ -97,15 +102,20 @@ RUN { \
|
||||||
echo 'opcache.enable=1'; \
|
echo 'opcache.enable=1'; \
|
||||||
echo 'opcache.interned_strings_buffer=32'; \
|
echo 'opcache.interned_strings_buffer=32'; \
|
||||||
echo 'opcache.max_accelerated_files=10000'; \
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
echo 'opcache.memory_consumption=128'; \
|
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
|
||||||
echo 'opcache.save_comments=1'; \
|
echo 'opcache.save_comments=1'; \
|
||||||
echo 'opcache.revalidate_freq=60'; \
|
echo 'opcache.revalidate_freq=60'; \
|
||||||
echo 'opcache.jit=1255'; \
|
echo 'opcache.jit=1255'; \
|
||||||
echo 'opcache.jit_buffer_size=128M'; \
|
echo 'opcache.jit_buffer_size=8M'; \
|
||||||
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
|
||||||
\
|
\
|
||||||
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
|
||||||
\
|
\
|
||||||
|
{ \
|
||||||
|
echo 'apc.serializer=igbinary'; \
|
||||||
|
echo 'session.serialize_handler=igbinary'; \
|
||||||
|
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
|
||||||
|
\
|
||||||
{ \
|
{ \
|
||||||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
|
28
README.md
28
README.md
|
@ -141,12 +141,23 @@ If mounting additional volumes under `/var/www/html`, you should consider:
|
||||||
|
|
||||||
**Data inside the main folder (`/var/www/html`) will be overridden/removed during installation and upgrades, unless listed in [upgrade.exclude](https://github.com/nextcloud/docker/blob/master/upgrade.exclude).** The additional volumes officially supported are already in that list, but custom volumes will need to be added by you. We suggest mounting custom storage volumes outside of `/var/www/html` and if possible read-only so that making this adjustment is unnecessary. If you must do so, however, you may build a custom image with a modified `/upgrade.exclude` file that incorporates your custom volume(s).
|
**Data inside the main folder (`/var/www/html`) will be overridden/removed during installation and upgrades, unless listed in [upgrade.exclude](https://github.com/nextcloud/docker/blob/master/upgrade.exclude).** The additional volumes officially supported are already in that list, but custom volumes will need to be added by you. We suggest mounting custom storage volumes outside of `/var/www/html` and if possible read-only so that making this adjustment is unnecessary. If you must do so, however, you may build a custom image with a modified `/upgrade.exclude` file that incorporates your custom volume(s).
|
||||||
|
|
||||||
|
## Running as an arbitrary user / file permissions / changing the default container user
|
||||||
|
|
||||||
|
The default user within a container is root (uid = 0). By default, processes inside the container will expect to have root privileges. Network services will drop privileges and use `www-data` to serve requests.
|
||||||
|
|
||||||
|
Depending on your volumes configuration, this can lead to permission issues. You can address this by running the container with a different default user. When changing the default user, the image will no longer assume it has root privileges and will run all processes under the specified uid. To accomplish this, use the `--user` / `user` option in your container environment.
|
||||||
|
|
||||||
|
See:
|
||||||
|
|
||||||
|
- https://docs.docker.com/engine/containers/run/#user
|
||||||
|
- https://github.com/docker-library/docs/tree/master/php#running-as-an-arbitrary-user
|
||||||
|
- https://docs.podman.io/en/stable/markdown/podman-run.1.html#user-u-user-group
|
||||||
|
|
||||||
## Accessing the Nextcloud command-line interface (`occ`)
|
## Accessing the Nextcloud command-line interface (`occ`)
|
||||||
|
|
||||||
To use the [Nextcloud command-line interface](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) (aka. `occ` command):
|
To use the [Nextcloud command-line interface](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) (aka. `occ` command):
|
||||||
```console
|
```console
|
||||||
$ docker exec --user www-data CONTAINER_ID php occ
|
$ docker exec -it --user www-data CONTAINER_ID php occ
|
||||||
```
|
```
|
||||||
or for docker compose:
|
or for docker compose:
|
||||||
```console
|
```console
|
||||||
|
@ -236,6 +247,7 @@ To use Redis for memory caching as well as PHP session storage, specify the foll
|
||||||
|
|
||||||
- `REDIS_HOST` (not set by default) Name of Redis container
|
- `REDIS_HOST` (not set by default) Name of Redis container
|
||||||
- `REDIS_HOST_PORT` (default: `6379`) Optional port for Redis, only use for external Redis servers that run on non-standard ports.
|
- `REDIS_HOST_PORT` (default: `6379`) Optional port for Redis, only use for external Redis servers that run on non-standard ports.
|
||||||
|
- `REDIS_HOST_USER` (not set by default) Optional username for Redis, only use for external Redis servers that require a user.
|
||||||
- `REDIS_HOST_PASSWORD` (not set by default) Redis password
|
- `REDIS_HOST_PASSWORD` (not set by default) Redis password
|
||||||
|
|
||||||
Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html) for more information.
|
Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html) for more information.
|
||||||
|
@ -277,6 +289,15 @@ To use an external S3 compatible object store as primary storage, set the follow
|
||||||
- `OBJECTSTORE_S3_OBJECT_PREFIX` (default: `urn:oid:`): Prefix to prepend to the fileid
|
- `OBJECTSTORE_S3_OBJECT_PREFIX` (default: `urn:oid:`): Prefix to prepend to the fileid
|
||||||
- `OBJECTSTORE_S3_AUTOCREATE` (default: `true`): Create the container if it does not exist
|
- `OBJECTSTORE_S3_AUTOCREATE` (default: `true`): Create the container if it does not exist
|
||||||
- `OBJECTSTORE_S3_SSE_C_KEY` (not set by default): Base64 encoded key with a maximum length of 32 bytes for server side encryption (SSE-C)
|
- `OBJECTSTORE_S3_SSE_C_KEY` (not set by default): Base64 encoded key with a maximum length of 32 bytes for server side encryption (SSE-C)
|
||||||
|
- `OBJECTSTORE_S3_CONCURRENCY` defines the maximum number of concurrent multipart uploads
|
||||||
|
- `OBJECTSTORE_S3_PROXY` (default: `false`)
|
||||||
|
- `OBJECTSTORE_S3_TIMEOUT` (not set by default)
|
||||||
|
- `OBJECTSTORE_S3_UPLOADPARTSIZE` (not set by default)
|
||||||
|
- `OBJECTSTORE_S3_PUTSIZELIMIT` (not set by default)
|
||||||
|
- `OBJECTSTORE_S3_USEMULTIPARTCOPY` (default: `false`)
|
||||||
|
- `OBJECTSTORE_S3_COPYSIZELIMIT` (not set by default)
|
||||||
|
- `OBJECTSTORE_S3_VERSION` (default: `latest`)
|
||||||
|
- `OBJECTSTORE_S3_VERIFY_BUCKET_EXISTS` (default: `true`) Setting this to `false` after confirming the bucket has been created may provide a performance benefit, but may not be possible in multibucket scenarios.
|
||||||
|
|
||||||
Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3) for more information.
|
Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3) for more information.
|
||||||
|
|
||||||
|
@ -299,6 +320,7 @@ Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/adm
|
||||||
To customize PHP limits you can change the following variables:
|
To customize PHP limits you can change the following variables:
|
||||||
- `PHP_MEMORY_LIMIT` (default `512M`) This sets the maximum amount of memory in bytes that a script is allowed to allocate. This is meant to help prevent poorly written scripts from eating up all available memory but it can prevent normal operation if set too tight.
|
- `PHP_MEMORY_LIMIT` (default `512M`) This sets the maximum amount of memory in bytes that a script is allowed to allocate. This is meant to help prevent poorly written scripts from eating up all available memory but it can prevent normal operation if set too tight.
|
||||||
- `PHP_UPLOAD_LIMIT` (default `512M`) This sets the upload limit (`post_max_size` and `upload_max_filesize`) for big files. Note that you may have to change other limits depending on your client, webserver or operating system. Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html) for more information.
|
- `PHP_UPLOAD_LIMIT` (default `512M`) This sets the upload limit (`post_max_size` and `upload_max_filesize`) for big files. Note that you may have to change other limits depending on your client, webserver or operating system. Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html) for more information.
|
||||||
|
- `PHP_OPCACHE_MEMORY_CONSUMPTION` (default `128`) This sets the `opcache.memory_consumption` value. It's the size of the shared memory storage used by OPcache, in megabytes.
|
||||||
|
|
||||||
### Apache Configuration
|
### Apache Configuration
|
||||||
|
|
||||||
|
@ -393,7 +415,7 @@ services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.11
|
image: mariadb:10.11
|
||||||
restart: always
|
restart: always
|
||||||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql
|
- db:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
|
@ -441,7 +463,7 @@ services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.11
|
image: mariadb:10.11
|
||||||
restart: always
|
restart: always
|
||||||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql
|
- db:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -23,32 +23,39 @@ run_as() {
|
||||||
run_path() {
|
run_path() {
|
||||||
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
local return_code=0
|
local return_code=0
|
||||||
|
local found=0
|
||||||
|
|
||||||
if ! [ -d "${hook_folder_path}" ]; then
|
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
|
||||||
echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist"
|
|
||||||
|
if ! [ -d "${hook_folder_path}" ] || directory_empty "${hook_folder_path}"; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder is empty (or does not exist)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | (
|
||||||
|
while read -r script_file_path; do
|
||||||
(
|
|
||||||
find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do
|
|
||||||
if ! [ -x "${script_file_path}" ]; then
|
if ! [ -x "${script_file_path}" ]; then
|
||||||
echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag"
|
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
|
||||||
|
found=$((found-1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
found=$((found+1))
|
||||||
run_as "${script_file_path}" || return_code="$?"
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
if [ "${return_code}" -ne "0" ]; then
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> Finished the script: \"${script_file_path}\""
|
echo "==> Finished executing the script: \"${script_file_path}\""
|
||||||
done
|
done
|
||||||
|
if [ "$found" -lt "1" ]; then
|
||||||
|
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
|
||||||
|
else
|
||||||
|
echo "=> Completed executing scripts in the \"$1\" folder"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +121,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
# check if redis host is an unix socket path
|
# check if redis host is an unix socket path
|
||||||
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
fi
|
fi
|
||||||
# check if redis password has been set
|
# check if redis password has been set
|
||||||
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_USER+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth[]=${REDIS_HOST_USER}&auth[]=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
fi
|
fi
|
||||||
|
@ -237,12 +252,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
echo "Setting trusted domains…"
|
echo "Setting trusted domains…"
|
||||||
|
set -f # turn off glob
|
||||||
NC_TRUSTED_DOMAIN_IDX=1
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
|
||||||
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=\"${DOMAIN}\""
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
|
set +f # turn glob back on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_path post-installation
|
run_path post-installation
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
stable_channel='30.0.4'
|
stable_channel='31.0.4'
|
||||||
|
|
||||||
self="$(basename "$BASH_SOURCE")"
|
self="$(basename "$BASH_SOURCE")"
|
||||||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
30.0.4
|
31.0.4
|
||||||
|
|
37
update.sh
37
update.sh
|
@ -2,7 +2,7 @@
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
declare -A alpine_version=(
|
declare -A alpine_version=(
|
||||||
[default]='3.20'
|
[default]='3.21'
|
||||||
)
|
)
|
||||||
|
|
||||||
declare -A debian_version=(
|
declare -A debian_version=(
|
||||||
|
@ -44,6 +44,24 @@ apcu_version="$(
|
||||||
| tail -1
|
| tail -1
|
||||||
)"
|
)"
|
||||||
|
|
||||||
|
igbinary_version="$(
|
||||||
|
git ls-remote --tags https://github.com/igbinary/igbinary.git \
|
||||||
|
| cut -d/ -f3 \
|
||||||
|
| grep -viE '[a-z]' \
|
||||||
|
| tr -d '^{}' \
|
||||||
|
| sort -V \
|
||||||
|
| tail -1
|
||||||
|
)"
|
||||||
|
|
||||||
|
imagick_version="$(
|
||||||
|
git ls-remote --tags https://github.com/imagick/imagick.git \
|
||||||
|
| cut -d/ -f3 \
|
||||||
|
| grep -viE '[a-z]' \
|
||||||
|
| tr -d '^{}' \
|
||||||
|
| sort -V \
|
||||||
|
| tail -1
|
||||||
|
)"
|
||||||
|
|
||||||
memcached_version="$(
|
memcached_version="$(
|
||||||
git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \
|
git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \
|
||||||
| cut -d/ -f3 \
|
| cut -d/ -f3 \
|
||||||
|
@ -62,20 +80,12 @@ redis_version="$(
|
||||||
| tail -1
|
| tail -1
|
||||||
)"
|
)"
|
||||||
|
|
||||||
imagick_version="$(
|
|
||||||
git ls-remote --tags https://github.com/mkoppanen/imagick.git \
|
|
||||||
| cut -d/ -f3 \
|
|
||||||
| grep -viE '[a-z]' \
|
|
||||||
| tr -d '^{}' \
|
|
||||||
| sort -V \
|
|
||||||
| tail -1
|
|
||||||
)"
|
|
||||||
|
|
||||||
declare -A pecl_versions=(
|
declare -A pecl_versions=(
|
||||||
[APCu]="$apcu_version"
|
[APCu]="$apcu_version"
|
||||||
|
[igbinary]="$igbinary_version"
|
||||||
|
[imagick]="$imagick_version"
|
||||||
[memcached]="$memcached_version"
|
[memcached]="$memcached_version"
|
||||||
[redis]="$redis_version"
|
[redis]="$redis_version"
|
||||||
[imagick]="$imagick_version"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
variants=(
|
variants=(
|
||||||
|
@ -84,7 +94,7 @@ variants=(
|
||||||
fpm-alpine
|
fpm-alpine
|
||||||
)
|
)
|
||||||
|
|
||||||
min_version='28'
|
min_version='29'
|
||||||
|
|
||||||
# version_greater_or_equal A B returns whether A >= B
|
# version_greater_or_equal A B returns whether A >= B
|
||||||
function version_greater_or_equal() {
|
function version_greater_or_equal() {
|
||||||
|
@ -121,9 +131,10 @@ function create_variant() {
|
||||||
s/%%CMD%%/'"${cmd[$variant]}"'/g;
|
s/%%CMD%%/'"${cmd[$variant]}"'/g;
|
||||||
s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g;
|
s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g;
|
||||||
s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g;
|
s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g;
|
||||||
|
s/%%IGBINARY_VERSION%%/'"${pecl_versions[igbinary]}"'/g;
|
||||||
|
s/%%IMAGICK_VERSION%%/'"${pecl_versions[imagick]}"'/g;
|
||||||
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
|
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
|
||||||
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
|
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
|
||||||
s/%%IMAGICK_VERSION%%/'"${pecl_versions[imagick]}"'/g;
|
|
||||||
s/%%CRONTAB_INT%%/'"$crontabInt"'/g;
|
s/%%CRONTAB_INT%%/'"$crontabInt"'/g;
|
||||||
' "$dir/Dockerfile"
|
' "$dir/Dockerfile"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"30": {
|
"31": {
|
||||||
"branch": "30",
|
"branch": "31",
|
||||||
"version": "30.0.4",
|
"version": "31.0.4",
|
||||||
"url": "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2",
|
"url": "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2",
|
||||||
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2.asc",
|
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-31.0.4.tar.bz2.asc",
|
||||||
"variants": {
|
"variants": {
|
||||||
"apache": {
|
"apache": {
|
||||||
"variant": "apache",
|
"variant": "apache",
|
||||||
|
@ -20,16 +20,42 @@
|
||||||
"fpm-alpine": {
|
"fpm-alpine": {
|
||||||
"variant": "fpm-alpine",
|
"variant": "fpm-alpine",
|
||||||
"base": "alpine",
|
"base": "alpine",
|
||||||
"baseVersion": "3.20",
|
"baseVersion": "3.21",
|
||||||
|
"phpVersion": "8.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"30": {
|
||||||
|
"branch": "30",
|
||||||
|
"version": "30.0.10",
|
||||||
|
"url": "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2",
|
||||||
|
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-30.0.10.tar.bz2.asc",
|
||||||
|
"variants": {
|
||||||
|
"apache": {
|
||||||
|
"variant": "apache",
|
||||||
|
"base": "debian",
|
||||||
|
"baseVersion": "bookworm",
|
||||||
|
"phpVersion": "8.2"
|
||||||
|
},
|
||||||
|
"fpm": {
|
||||||
|
"variant": "fpm",
|
||||||
|
"base": "debian",
|
||||||
|
"baseVersion": "bookworm",
|
||||||
|
"phpVersion": "8.2"
|
||||||
|
},
|
||||||
|
"fpm-alpine": {
|
||||||
|
"variant": "fpm-alpine",
|
||||||
|
"base": "alpine",
|
||||||
|
"baseVersion": "3.21",
|
||||||
"phpVersion": "8.2"
|
"phpVersion": "8.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"29": {
|
"29": {
|
||||||
"branch": "29",
|
"branch": "29",
|
||||||
"version": "29.0.10",
|
"version": "29.0.16",
|
||||||
"url": "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2",
|
"url": "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2",
|
||||||
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-29.0.10.tar.bz2.asc",
|
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-29.0.16.tar.bz2.asc",
|
||||||
"variants": {
|
"variants": {
|
||||||
"apache": {
|
"apache": {
|
||||||
"variant": "apache",
|
"variant": "apache",
|
||||||
|
@ -46,33 +72,7 @@
|
||||||
"fpm-alpine": {
|
"fpm-alpine": {
|
||||||
"variant": "fpm-alpine",
|
"variant": "fpm-alpine",
|
||||||
"base": "alpine",
|
"base": "alpine",
|
||||||
"baseVersion": "3.20",
|
"baseVersion": "3.21",
|
||||||
"phpVersion": "8.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"28": {
|
|
||||||
"branch": "28",
|
|
||||||
"version": "28.0.14",
|
|
||||||
"url": "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2",
|
|
||||||
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-28.0.14.tar.bz2.asc",
|
|
||||||
"variants": {
|
|
||||||
"apache": {
|
|
||||||
"variant": "apache",
|
|
||||||
"base": "debian",
|
|
||||||
"baseVersion": "bookworm",
|
|
||||||
"phpVersion": "8.2"
|
|
||||||
},
|
|
||||||
"fpm": {
|
|
||||||
"variant": "fpm",
|
|
||||||
"base": "debian",
|
|
||||||
"baseVersion": "bookworm",
|
|
||||||
"phpVersion": "8.2"
|
|
||||||
},
|
|
||||||
"fpm-alpine": {
|
|
||||||
"variant": "fpm-alpine",
|
|
||||||
"base": "alpine",
|
|
||||||
"baseVersion": "3.20",
|
|
||||||
"phpVersion": "8.2"
|
"phpVersion": "8.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue