mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-20 04:19:18 +00:00
nextcloud: fix Dockerfile, closes #84
This commit is contained in:
parent
2fc8b01c49
commit
5817b850bf
@ -2,12 +2,14 @@ FROM alpine:edge
|
|||||||
|
|
||||||
ARG NEXTCLOUD_VERSION=11.0.2
|
ARG NEXTCLOUD_VERSION=11.0.2
|
||||||
ARG GNU_LIBICONV_VERSION=1.15
|
ARG GNU_LIBICONV_VERSION=1.15
|
||||||
|
ARG PHP_SOURCES_VERSION=7.1.3
|
||||||
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
|
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
|
||||||
|
|
||||||
ENV UID=991 GID=991 \
|
ENV UID=991 GID=991 \
|
||||||
UPLOAD_MAX_SIZE=10G \
|
UPLOAD_MAX_SIZE=10G \
|
||||||
APC_SHM_SIZE=128M \
|
APC_SHM_SIZE=128M \
|
||||||
OPCACHE_MEM_SIZE=128 \
|
OPCACHE_MEM_SIZE=128 \
|
||||||
|
MEMORY_LIMIT=512M \
|
||||||
CRON_PERIOD=15m \
|
CRON_PERIOD=15m \
|
||||||
CRON_MEMORY_LIMIT=1g \
|
CRON_MEMORY_LIMIT=1g \
|
||||||
TZ=Etc/UTC \
|
TZ=Etc/UTC \
|
||||||
@ -15,6 +17,7 @@ ENV UID=991 GID=991 \
|
|||||||
DOMAIN=localhost
|
DOMAIN=localhost
|
||||||
|
|
||||||
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||||
|
&& echo "@stable https://nl.alpinelinux.org/alpine/latest-stable/main" >> /etc/apk/repositories \
|
||||||
&& BUILD_DEPS=" \
|
&& BUILD_DEPS=" \
|
||||||
gnupg \
|
gnupg \
|
||||||
tar \
|
tar \
|
||||||
@ -26,7 +29,7 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
|||||||
samba-dev" \
|
samba-dev" \
|
||||||
&& apk -U upgrade && apk add \
|
&& apk -U upgrade && apk add \
|
||||||
${BUILD_DEPS} \
|
${BUILD_DEPS} \
|
||||||
nginx \
|
nginx@stable \
|
||||||
s6 \
|
s6 \
|
||||||
libressl \
|
libressl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -34,52 +37,53 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
|||||||
samba-client \
|
samba-client \
|
||||||
su-exec \
|
su-exec \
|
||||||
tzdata \
|
tzdata \
|
||||||
php7.1@testing \
|
php7@testing \
|
||||||
php7.1-fpm@testing \
|
php7-fpm@testing \
|
||||||
php7.1-intl@testing \
|
php7-intl@testing \
|
||||||
php7.1-mbstring@testing \
|
php7-mbstring@testing \
|
||||||
php7.1-curl@testing \
|
php7-curl@testing \
|
||||||
php7.1-gd@testing \
|
php7-gd@testing \
|
||||||
php7.1-fileinfo@testing \
|
php7-fileinfo@testing \
|
||||||
php7.1-mcrypt@testing \
|
php7-mcrypt@testing \
|
||||||
php7.1-opcache@testing \
|
php7-opcache@testing \
|
||||||
php7.1-json@testing \
|
php7-json@testing \
|
||||||
php7.1-session@testing \
|
php7-session@testing \
|
||||||
php7.1-pdo@testing \
|
php7-pdo@testing \
|
||||||
php7.1-dom@testing \
|
php7-dom@testing \
|
||||||
php7.1-ctype@testing \
|
php7-ctype@testing \
|
||||||
php7.1-pdo_mysql@testing \
|
php7-mysqlnd@testing \
|
||||||
php7.1-pdo_pgsql@testing \
|
php7-pdo_mysql@testing \
|
||||||
php7.1-pgsql@testing \
|
php7-pdo_pgsql@testing \
|
||||||
php7.1-pdo_sqlite@testing \
|
php7-pgsql@testing \
|
||||||
php7.1-sqlite3@testing \
|
php7-pdo_sqlite@testing \
|
||||||
php7.1-zlib@testing \
|
php7-sqlite3@testing \
|
||||||
php7.1-zip@testing \
|
php7-zlib@testing \
|
||||||
php7.1-xmlreader@testing \
|
php7-zip@testing \
|
||||||
php7.1-xml@testing \
|
php7-xmlreader@testing \
|
||||||
php7.1-xmlwriter@testing \
|
php7-xml@testing \
|
||||||
php7.1-posix@testing \
|
php7-xmlwriter@testing \
|
||||||
php7.1-openssl@testing \
|
php7-posix@testing \
|
||||||
php7.1-ldap@testing \
|
php7-openssl@testing \
|
||||||
php7.1-imap@testing \
|
php7-ldap@testing \
|
||||||
php7.1-ftp@testing \
|
php7-imap@testing \
|
||||||
php7.1-pcntl@testing \
|
php7-ftp@testing \
|
||||||
php7.1-exif@testing \
|
php7-pcntl@testing \
|
||||||
php7.1-pear@testing \
|
php7-exif@testing \
|
||||||
php7.1-dev@testing \
|
php7-pear@testing \
|
||||||
|
php7-dev@testing \
|
||||||
&& pecl install smbclient apcu redis \
|
&& pecl install smbclient apcu redis \
|
||||||
&& cd /tmp && wget -q http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${GNU_LIBICONV_VERSION}.tar.gz \
|
&& cd /tmp && wget -q http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${GNU_LIBICONV_VERSION}.tar.gz \
|
||||||
&& tar xzf libiconv-${GNU_LIBICONV_VERSION}.tar.gz && cd libiconv-${GNU_LIBICONV_VERSION} \
|
&& tar xzf libiconv-${GNU_LIBICONV_VERSION}.tar.gz && cd libiconv-${GNU_LIBICONV_VERSION} \
|
||||||
&& ./configure --prefix=/usr/local \
|
&& ./configure --prefix=/usr/local \
|
||||||
&& make && make install && libtool --finish /usr/local/lib && cd /tmp \
|
&& make && make install && libtool --finish /usr/local/lib && cd /tmp \
|
||||||
&& wget -q http://is1.php.net/get/php-7.1.2.tar.gz/from/this/mirror -O php7.1.tar.gz \
|
&& wget -q http://is1.php.net/get/php-${PHP_SOURCES_VERSION}.tar.gz/from/this/mirror -O php7.tar.gz \
|
||||||
&& tar xzf php7.1.tar.gz && cd /tmp/php-7.1.2/ext/iconv && phpize7.1 \
|
&& tar xzf php7.tar.gz && cd /tmp/php-${PHP_SOURCES_VERSION}/ext/iconv && phpize7 \
|
||||||
&& ./configure --with-iconv=/usr/local --with-php-config=/usr/bin/php-config7.1 \
|
&& ./configure --with-iconv=/usr/local --with-php-config=/usr/bin/php-config7 \
|
||||||
&& make && cp modules/iconv.so /usr/lib/php7.1 && cd /tmp \
|
&& make && cp modules/iconv.so /usr/lib/php7 && cd /tmp \
|
||||||
&& echo "extension=iconv.so" > /etc/php7.1/conf.d/00_iconv.ini \
|
&& echo "extension=iconv.so" > /etc/php7/conf.d/00_iconv.ini \
|
||||||
&& echo "extension=smbclient.so" > /etc/php7.1/conf.d/00_smbclient.ini \
|
&& echo "extension=smbclient.so" > /etc/php7/conf.d/00_smbclient.ini \
|
||||||
&& echo "extension=redis.so" > /etc/php7.1/conf.d/redis.ini \
|
&& echo "extension=redis.so" > /etc/php7/conf.d/redis.ini \
|
||||||
&& sed -i 's|;session.save_path = "/tmp"|session.save_path = "/data/session"|g' /etc/php7.1/php.ini \
|
&& sed -i 's|;session.save_path = "/tmp"|session.save_path = "/data/session"|g' /etc/php7/php.ini \
|
||||||
&& mkdir /nextcloud \
|
&& mkdir /nextcloud \
|
||||||
&& NEXTCLOUD_TARBALL="nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
|
&& NEXTCLOUD_TARBALL="nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
|
||||||
&& wget -q https://download.nextcloud.com/server/releases/${NEXTCLOUD_TARBALL} \
|
&& wget -q https://download.nextcloud.com/server/releases/${NEXTCLOUD_TARBALL} \
|
||||||
@ -96,13 +100,13 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
|||||||
&& if [ "${FINGERPRINT}" != "${GPG_nextcloud}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
|
&& if [ "${FINGERPRINT}" != "${GPG_nextcloud}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
|
||||||
&& echo "All seems good, now unpacking ${NEXTCLOUD_TARBALL}..." \
|
&& echo "All seems good, now unpacking ${NEXTCLOUD_TARBALL}..." \
|
||||||
&& tar xjf ${NEXTCLOUD_TARBALL} --strip 1 -C /nextcloud \
|
&& tar xjf ${NEXTCLOUD_TARBALL} --strip 1 -C /nextcloud \
|
||||||
&& apk del ${BUILD_DEPS} php7.1-pear php7.1-dev \
|
&& apk del ${BUILD_DEPS} php7-pear php7-dev \
|
||||||
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
|
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY php-fpm.conf /etc/php7.1/php-fpm.conf
|
COPY php-fpm.conf /etc/php7/php-fpm.conf
|
||||||
COPY opcache.ini /etc/php7.1/conf.d/00_opcache.ini
|
COPY opcache.ini /etc/php7/conf.d/00_opcache.ini
|
||||||
COPY apcu.ini /etc/php7.1/conf.d/apcu.ini
|
COPY apcu.ini /etc/php7/conf.d/apcu.ini
|
||||||
COPY run.sh /usr/local/bin/run.sh
|
COPY run.sh /usr/local/bin/run.sh
|
||||||
COPY setup.sh /usr/local/bin/setup.sh
|
COPY setup.sh /usr/local/bin/setup.sh
|
||||||
COPY occ /usr/local/bin/occ
|
COPY occ /usr/local/bin/occ
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
su-exec $UID:$GID php7.1 /nextcloud/occ $@
|
su-exec $UID:$GID php7 /nextcloud/occ $@
|
||||||
|
@ -16,3 +16,4 @@ php_admin_value[upload_max_filesize] = <UPLOAD_MAX_SIZE>
|
|||||||
php_admin_value[max_execution_time] = 10800
|
php_admin_value[max_execution_time] = 10800
|
||||||
php_admin_value[max_input_time] = 3600
|
php_admin_value[max_input_time] = 3600
|
||||||
php_admin_value[expose_php] = Off
|
php_admin_value[expose_php] = Off
|
||||||
|
php_admin_value[memory_limit] = <MEMORY_LIMIT>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /etc/nginx/nginx.conf /etc/php7.1/php-fpm.conf \
|
sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /etc/nginx/nginx.conf /etc/php7/php-fpm.conf \
|
||||||
-e "s/<APC_SHM_SIZE>/$APC_SHM_SIZE/g" /etc/php7.1/conf.d/apcu.ini \
|
-e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /etc/php7/php-fpm.conf \
|
||||||
-e "s/<OPCACHE_MEM_SIZE>/$OPCACHE_MEM_SIZE/g" /etc/php7.1/conf.d/00_opcache.ini \
|
-e "s/<APC_SHM_SIZE>/$APC_SHM_SIZE/g" /etc/php7/conf.d/apcu.ini \
|
||||||
|
-e "s/<OPCACHE_MEM_SIZE>/$OPCACHE_MEM_SIZE/g" /etc/php7/conf.d/00_opcache.ini \
|
||||||
-e "s/<CRON_MEMORY_LIMIT>/$CRON_MEMORY_LIMIT/g" /etc/s6.d/cron/run \
|
-e "s/<CRON_MEMORY_LIMIT>/$CRON_MEMORY_LIMIT/g" /etc/s6.d/cron/run \
|
||||||
-e "s/<CRON_PERIOD>/$CRON_PERIOD/g" /etc/s6.d/cron/run
|
-e "s/<CRON_PERIOD>/$CRON_PERIOD/g" /etc/s6.d/cron/run
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ if [ ! -d /data/session ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updating permissions..."
|
echo "Updating permissions..."
|
||||||
for dir in /nextcloud /data /config /apps2 /etc/nginx /etc/php7.1 /var/log /var/lib/nginx /tmp /etc/s6.d; do
|
for dir in /nextcloud /data /config /apps2 /etc/nginx /etc/php7 /var/log /var/lib/nginx /tmp /etc/s6.d; do
|
||||||
if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
|
if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
|
||||||
echo "Updating permissions in $dir..."
|
echo "Updating permissions in $dir..."
|
||||||
chown -R $UID:$GID $dir
|
chown -R $UID:$GID $dir
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
php7.1 -d memory_limit=<CRON_MEMORY_LIMIT> -f /nextcloud/cron.php
|
php7 -d memory_limit=<CRON_MEMORY_LIMIT> -f /nextcloud/cron.php
|
||||||
sleep <CRON_PERIOD>
|
sleep <CRON_PERIOD>
|
||||||
done
|
done
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec php-fpm7.1
|
exec php-fpm7
|
||||||
|
@ -67,7 +67,7 @@ echo "Starting automatic configuration..."
|
|||||||
# Execute ownCloud's setup step, which creates the ownCloud database.
|
# Execute ownCloud's setup step, which creates the ownCloud database.
|
||||||
# It also wipes it if it exists. And it updates config.php with database
|
# It also wipes it if it exists. And it updates config.php with database
|
||||||
# settings and deletes the autoconfig.php file.
|
# settings and deletes the autoconfig.php file.
|
||||||
(cd /nextcloud; php7.1 index.php &>/dev/null)
|
(cd /nextcloud; php7 index.php &>/dev/null)
|
||||||
echo "Automatic configuration finished."
|
echo "Automatic configuration finished."
|
||||||
|
|
||||||
# Update config.php.
|
# Update config.php.
|
||||||
@ -81,7 +81,7 @@ echo "Automatic configuration finished."
|
|||||||
# Use PHP to read the settings file, modify it, and write out the new settings array.
|
# Use PHP to read the settings file, modify it, and write out the new settings array.
|
||||||
|
|
||||||
CONFIG_TEMP=$(/bin/mktemp)
|
CONFIG_TEMP=$(/bin/mktemp)
|
||||||
php7.1 <<EOF > $CONFIG_TEMP && mv $CONFIG_TEMP $CONFIGFILE
|
php7 <<EOF > $CONFIG_TEMP && mv $CONFIG_TEMP $CONFIGFILE
|
||||||
<?php
|
<?php
|
||||||
include("/config/config.php");
|
include("/config/config.php");
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
FROM alpine:edge
|
FROM alpine:edge
|
||||||
|
|
||||||
ARG GNU_LIBICONV_VERSION=1.15
|
ARG GNU_LIBICONV_VERSION=1.15
|
||||||
|
ARG PHP_SOURCES_VERSION=7.1.3
|
||||||
|
|
||||||
ENV UID=991 GID=991 \
|
ENV UID=991 GID=991 \
|
||||||
UPLOAD_MAX_SIZE=10G \
|
UPLOAD_MAX_SIZE=10G \
|
||||||
APC_SHM_SIZE=128M \
|
APC_SHM_SIZE=128M \
|
||||||
OPCACHE_MEM_SIZE=128 \
|
OPCACHE_MEM_SIZE=128 \
|
||||||
|
MEMORY_LIMIT=512M \
|
||||||
CRON_PERIOD=15m \
|
CRON_PERIOD=15m \
|
||||||
CRON_MEMORY_LIMIT=1g \
|
CRON_MEMORY_LIMIT=1g \
|
||||||
TZ=Etc/UTC \
|
TZ=Etc/UTC \
|
||||||
@ -13,6 +15,7 @@ ENV UID=991 GID=991 \
|
|||||||
DOMAIN=localhost
|
DOMAIN=localhost
|
||||||
|
|
||||||
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||||
|
&& echo "@stable https://nl.alpinelinux.org/alpine/latest-stable/main" >> /etc/apk/repositories \
|
||||||
&& BUILD_DEPS=" \
|
&& BUILD_DEPS=" \
|
||||||
gnupg \
|
gnupg \
|
||||||
tar \
|
tar \
|
||||||
@ -24,7 +27,7 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
|||||||
samba-dev" \
|
samba-dev" \
|
||||||
&& apk -U upgrade && apk add \
|
&& apk -U upgrade && apk add \
|
||||||
${BUILD_DEPS} \
|
${BUILD_DEPS} \
|
||||||
nginx \
|
nginx@stable \
|
||||||
s6 \
|
s6 \
|
||||||
libressl \
|
libressl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -32,52 +35,53 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
|||||||
samba-client \
|
samba-client \
|
||||||
su-exec \
|
su-exec \
|
||||||
tzdata \
|
tzdata \
|
||||||
php7.1@testing \
|
php7@testing \
|
||||||
php7.1-fpm@testing \
|
php7-fpm@testing \
|
||||||
php7.1-intl@testing \
|
php7-intl@testing \
|
||||||
php7.1-mbstring@testing \
|
php7-mbstring@testing \
|
||||||
php7.1-curl@testing \
|
php7-curl@testing \
|
||||||
php7.1-gd@testing \
|
php7-gd@testing \
|
||||||
php7.1-fileinfo@testing \
|
php7-fileinfo@testing \
|
||||||
php7.1-mcrypt@testing \
|
php7-mcrypt@testing \
|
||||||
php7.1-opcache@testing \
|
php7-opcache@testing \
|
||||||
php7.1-json@testing \
|
php7-json@testing \
|
||||||
php7.1-session@testing \
|
php7-session@testing \
|
||||||
php7.1-pdo@testing \
|
php7-pdo@testing \
|
||||||
php7.1-dom@testing \
|
php7-dom@testing \
|
||||||
php7.1-ctype@testing \
|
php7-ctype@testing \
|
||||||
php7.1-pdo_mysql@testing \
|
php7-mysqlnd@testing \
|
||||||
php7.1-pdo_pgsql@testing \
|
php7-pdo_mysql@testing \
|
||||||
php7.1-pgsql@testing \
|
php7-pdo_pgsql@testing \
|
||||||
php7.1-pdo_sqlite@testing \
|
php7-pgsql@testing \
|
||||||
php7.1-sqlite3@testing \
|
php7-pdo_sqlite@testing \
|
||||||
php7.1-zlib@testing \
|
php7-sqlite3@testing \
|
||||||
php7.1-zip@testing \
|
php7-zlib@testing \
|
||||||
php7.1-xmlreader@testing \
|
php7-zip@testing \
|
||||||
php7.1-xml@testing \
|
php7-xmlreader@testing \
|
||||||
php7.1-xmlwriter@testing \
|
php7-xml@testing \
|
||||||
php7.1-posix@testing \
|
php7-xmlwriter@testing \
|
||||||
php7.1-openssl@testing \
|
php7-posix@testing \
|
||||||
php7.1-ldap@testing \
|
php7-openssl@testing \
|
||||||
php7.1-imap@testing \
|
php7-ldap@testing \
|
||||||
php7.1-ftp@testing \
|
php7-imap@testing \
|
||||||
php7.1-pcntl@testing \
|
php7-ftp@testing \
|
||||||
php7.1-exif@testing \
|
php7-pcntl@testing \
|
||||||
php7.1-pear@testing \
|
php7-exif@testing \
|
||||||
php7.1-dev@testing \
|
php7-pear@testing \
|
||||||
|
php7-dev@testing \
|
||||||
&& pecl install smbclient apcu redis \
|
&& pecl install smbclient apcu redis \
|
||||||
&& cd /tmp && wget -q http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${GNU_LIBICONV_VERSION}.tar.gz \
|
&& cd /tmp && wget -q http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${GNU_LIBICONV_VERSION}.tar.gz \
|
||||||
&& tar xzf libiconv-${GNU_LIBICONV_VERSION}.tar.gz && cd libiconv-${GNU_LIBICONV_VERSION} \
|
&& tar xzf libiconv-${GNU_LIBICONV_VERSION}.tar.gz && cd libiconv-${GNU_LIBICONV_VERSION} \
|
||||||
&& ./configure --prefix=/usr/local \
|
&& ./configure --prefix=/usr/local \
|
||||||
&& make && make install && libtool --finish /usr/local/lib && cd /tmp \
|
&& make && make install && libtool --finish /usr/local/lib && cd /tmp \
|
||||||
&& wget -q http://is1.php.net/get/php-7.1.2.tar.gz/from/this/mirror -O php7.1.tar.gz \
|
&& wget -q http://is1.php.net/get/php-${PHP_SOURCES_VERSION}.tar.gz/from/this/mirror -O php7.tar.gz \
|
||||||
&& tar xzf php7.1.tar.gz && cd /tmp/php-7.1.2/ext/iconv && phpize7.1 \
|
&& tar xzf php7.tar.gz && cd /tmp/php-${PHP_SOURCES_VERSION}/ext/iconv && phpize7 \
|
||||||
&& ./configure --with-iconv=/usr/local --with-php-config=/usr/bin/php-config7.1 \
|
&& ./configure --with-iconv=/usr/local --with-php-config=/usr/bin/php-config7 \
|
||||||
&& make && cp modules/iconv.so /usr/lib/php7.1 && cd /tmp \
|
&& make && cp modules/iconv.so /usr/lib/php7 && cd /tmp \
|
||||||
&& echo "extension=iconv.so" > /etc/php7.1/conf.d/00_iconv.ini \
|
&& echo "extension=iconv.so" > /etc/php7/conf.d/00_iconv.ini \
|
||||||
&& echo "extension=smbclient.so" > /etc/php7.1/conf.d/00_smbclient.ini \
|
&& echo "extension=smbclient.so" > /etc/php7/conf.d/00_smbclient.ini \
|
||||||
&& echo "extension=redis.so" > /etc/php7.1/conf.d/redis.ini \
|
&& echo "extension=redis.so" > /etc/php7/conf.d/redis.ini \
|
||||||
&& sed -i 's|;session.save_path = "/tmp"|session.save_path = "/data/session"|g' /etc/php7.1/php.ini \
|
&& sed -i 's|;session.save_path = "/tmp"|session.save_path = "/data/session"|g' /etc/php7/php.ini \
|
||||||
&& mkdir /nextcloud \
|
&& mkdir /nextcloud \
|
||||||
&& wget -q https://download.nextcloud.com/server/daily/latest.tar.bz2 \
|
&& wget -q https://download.nextcloud.com/server/daily/latest.tar.bz2 \
|
||||||
&& echo "Verifying checksum of latest.tar.bz2..." \
|
&& echo "Verifying checksum of latest.tar.bz2..." \
|
||||||
@ -86,13 +90,13 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
|||||||
&& CHECKSUM_STATE=$(echo -n $(sha512sum -c latest.tar.bz2.sha512) | tail -c 2) \
|
&& CHECKSUM_STATE=$(echo -n $(sha512sum -c latest.tar.bz2.sha512) | tail -c 2) \
|
||||||
&& if [ "${CHECKSUM_STATE}" != "OK" ]; then echo "Warning! Checksum does not match!" && exit 1; fi \
|
&& if [ "${CHECKSUM_STATE}" != "OK" ]; then echo "Warning! Checksum does not match!" && exit 1; fi \
|
||||||
&& tar xjf latest.tar.bz2 --strip 1 -C /nextcloud \
|
&& tar xjf latest.tar.bz2 --strip 1 -C /nextcloud \
|
||||||
&& apk del ${BUILD_DEPS} php7.1-pear php7.1-dev \
|
&& apk del ${BUILD_DEPS} php7-pear php7-dev \
|
||||||
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
|
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY php-fpm.conf /etc/php7.1/php-fpm.conf
|
COPY php-fpm.conf /etc/php7/php-fpm.conf
|
||||||
COPY opcache.ini /etc/php7.1/conf.d/00_opcache.ini
|
COPY opcache.ini /etc/php7/conf.d/00_opcache.ini
|
||||||
COPY apcu.ini /etc/php7.1/conf.d/apcu.ini
|
COPY apcu.ini /etc/php7/conf.d/apcu.ini
|
||||||
COPY run.sh /usr/local/bin/run.sh
|
COPY run.sh /usr/local/bin/run.sh
|
||||||
COPY setup.sh /usr/local/bin/setup.sh
|
COPY setup.sh /usr/local/bin/setup.sh
|
||||||
COPY occ /usr/local/bin/occ
|
COPY occ /usr/local/bin/occ
|
||||||
@ -105,7 +109,7 @@ VOLUME /data /config /apps2 /nextcloud/themes
|
|||||||
EXPOSE 8888
|
EXPOSE 8888
|
||||||
|
|
||||||
LABEL description="A server software for creating file hosting services" \
|
LABEL description="A server software for creating file hosting services" \
|
||||||
nextcloud="Nextcloud daily" \
|
nextcloud="Nextcloud daily build" \
|
||||||
maintainer="Wonderfall <wonderfall@targaryen.house>"
|
maintainer="Wonderfall <wonderfall@targaryen.house>"
|
||||||
|
|
||||||
CMD ["run.sh"]
|
CMD ["run.sh"]
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
su-exec $UID:$GID php7.1 /nextcloud/occ $@
|
su-exec $UID:$GID php7 /nextcloud/occ $@
|
||||||
|
@ -16,3 +16,4 @@ php_admin_value[upload_max_filesize] = <UPLOAD_MAX_SIZE>
|
|||||||
php_admin_value[max_execution_time] = 10800
|
php_admin_value[max_execution_time] = 10800
|
||||||
php_admin_value[max_input_time] = 3600
|
php_admin_value[max_input_time] = 3600
|
||||||
php_admin_value[expose_php] = Off
|
php_admin_value[expose_php] = Off
|
||||||
|
php_admin_value[memory_limit] = <MEMORY_LIMIT>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /etc/nginx/nginx.conf /etc/php7.1/php-fpm.conf \
|
sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /etc/nginx/nginx.conf /etc/php7/php-fpm.conf \
|
||||||
-e "s/<APC_SHM_SIZE>/$APC_SHM_SIZE/g" /etc/php7.1/conf.d/apcu.ini \
|
-e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /etc/php7/php-fpm.conf \
|
||||||
-e "s/<OPCACHE_MEM_SIZE>/$OPCACHE_MEM_SIZE/g" /etc/php7.1/conf.d/00_opcache.ini \
|
-e "s/<APC_SHM_SIZE>/$APC_SHM_SIZE/g" /etc/php7/conf.d/apcu.ini \
|
||||||
|
-e "s/<OPCACHE_MEM_SIZE>/$OPCACHE_MEM_SIZE/g" /etc/php7/conf.d/00_opcache.ini \
|
||||||
-e "s/<CRON_MEMORY_LIMIT>/$CRON_MEMORY_LIMIT/g" /etc/s6.d/cron/run \
|
-e "s/<CRON_MEMORY_LIMIT>/$CRON_MEMORY_LIMIT/g" /etc/s6.d/cron/run \
|
||||||
-e "s/<CRON_PERIOD>/$CRON_PERIOD/g" /etc/s6.d/cron/run
|
-e "s/<CRON_PERIOD>/$CRON_PERIOD/g" /etc/s6.d/cron/run
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ if [ ! -d /data/session ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updating permissions..."
|
echo "Updating permissions..."
|
||||||
for dir in /nextcloud /data /config /apps2 /etc/nginx /etc/php7.1 /var/log /var/lib/nginx /tmp /etc/s6.d; do
|
for dir in /nextcloud /data /config /apps2 /etc/nginx /etc/php7 /var/log /var/lib/nginx /tmp /etc/s6.d; do
|
||||||
if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
|
if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
|
||||||
echo "Updating permissions in $dir..."
|
echo "Updating permissions in $dir..."
|
||||||
chown -R $UID:$GID $dir
|
chown -R $UID:$GID $dir
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
php7.1 -d memory_limit=<CRON_MEMORY_LIMIT> -f /nextcloud/cron.php
|
php7 -d memory_limit=<CRON_MEMORY_LIMIT> -f /nextcloud/cron.php
|
||||||
sleep <CRON_PERIOD>
|
sleep <CRON_PERIOD>
|
||||||
done
|
done
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec php-fpm7.1
|
exec php-fpm7
|
||||||
|
@ -67,7 +67,7 @@ echo "Starting automatic configuration..."
|
|||||||
# Execute ownCloud's setup step, which creates the ownCloud database.
|
# Execute ownCloud's setup step, which creates the ownCloud database.
|
||||||
# It also wipes it if it exists. And it updates config.php with database
|
# It also wipes it if it exists. And it updates config.php with database
|
||||||
# settings and deletes the autoconfig.php file.
|
# settings and deletes the autoconfig.php file.
|
||||||
(cd /nextcloud; php7.1 index.php &>/dev/null)
|
(cd /nextcloud; php7 index.php &>/dev/null)
|
||||||
echo "Automatic configuration finished."
|
echo "Automatic configuration finished."
|
||||||
|
|
||||||
# Update config.php.
|
# Update config.php.
|
||||||
@ -81,7 +81,7 @@ echo "Automatic configuration finished."
|
|||||||
# Use PHP to read the settings file, modify it, and write out the new settings array.
|
# Use PHP to read the settings file, modify it, and write out the new settings array.
|
||||||
|
|
||||||
CONFIG_TEMP=$(/bin/mktemp)
|
CONFIG_TEMP=$(/bin/mktemp)
|
||||||
php7.1 <<EOF > $CONFIG_TEMP && mv $CONFIG_TEMP $CONFIGFILE
|
php7 <<EOF > $CONFIG_TEMP && mv $CONFIG_TEMP $CONFIGFILE
|
||||||
<?php
|
<?php
|
||||||
include("/config/config.php");
|
include("/config/config.php");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user