mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-20 04:19:18 +00:00
nextcloud: some improvements
- clean Dockerfile - fixes #10 - less memory consumption
This commit is contained in:
parent
5fb4664200
commit
a58d6bcb4a
@ -2,27 +2,18 @@ FROM alpine:edge
|
||||
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
|
||||
|
||||
ARG NEXTCLOUD_VERSION=9.0.51
|
||||
ARG APCU_VERSION=5.1.5
|
||||
ARG APCUBC_VERSION=1.0.3
|
||||
|
||||
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
|
||||
|
||||
ENV GID=991 UID=991
|
||||
|
||||
RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
||||
&& echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||
&& BUILD_DEPS=" \
|
||||
build-base \
|
||||
autoconf \
|
||||
gnupg \
|
||||
tar" \
|
||||
&& BUILD_DEPS="gnupg tar ca-certificates" \
|
||||
&& apk -U add \
|
||||
$BUILD_DEPS \
|
||||
${BUILD_DEPS} \
|
||||
nginx \
|
||||
supervisor \
|
||||
openssl \
|
||||
ca-certificates \
|
||||
libwebp \
|
||||
tini@commuedge \
|
||||
php7@testing \
|
||||
php7-fpm@testing \
|
||||
@ -45,19 +36,16 @@ RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/ap
|
||||
php7-xmlreader@testing \
|
||||
php7-posix@testing \
|
||||
php7-openssl@testing \
|
||||
php7-dev@testing \
|
||||
php7-pear@testing \
|
||||
php7-apcu@testing \
|
||||
&& mkdir /nextcloud && cd /tmp \
|
||||
&& 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}.sha256 \
|
||||
&& wget -q https://download.nextcloud.com/server/releases/${NEXTCLOUD_TARBALL}.asc \
|
||||
&& wget -q https://pecl.php.net/get/apcu-${APCU_VERSION}.tgz \
|
||||
&& wget -q https://pecl.php.net/get/apcu_bc-${APCUBC_VERSION}.tgz \
|
||||
&& wget -q https://nextcloud.com/nextcloud.asc \
|
||||
&& echo "Verifying both integrity and authenticity of ${NEXTCLOUD_TARBALL}..." \
|
||||
&& CHECKSUM_STATE=$(echo -n $(sha256sum -c ${NEXTCLOUD_TARBALL}.sha256) | tail -c 2) \
|
||||
&& if [ "${CHECKSUM_STATE}" != "OK" ]; then echo "Warning! Checksum does not match!" && exit 1; fi \
|
||||
&& wget -q https://nextcloud.com/nextcloud.asc \
|
||||
&& gpg --import nextcloud.asc \
|
||||
&& FINGERPRINT="$(LANG=C gpg --verify ${NEXTCLOUD_TARBALL}.asc ${NEXTCLOUD_TARBALL} 2>&1 \
|
||||
| sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \
|
||||
@ -65,11 +53,9 @@ RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/ap
|
||||
&& if [ "${FINGERPRINT}" != "${GPG_nextcloud}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
|
||||
&& echo "All seems good, now unpacking ${NEXTCLOUD_TARBALL}..." \
|
||||
&& tar xjf ${NEXTCLOUD_TARBALL} --strip 1 -C /nextcloud \
|
||||
&& tar xzf apcu-${APCU_VERSION}.tgz && tar xzf apcu_bc-${APCUBC_VERSION}.tgz \
|
||||
&& cd apcu-${APCU_VERSION} && phpize7 && ./configure --with-php-config=/usr/bin/php-config7 && make && make install \
|
||||
&& cd ../apcu_bc-${APCUBC_VERSION} && phpize7 && ./configure --with-php-config=/usr/bin/php-config7 && make && make install \
|
||||
&& sed -i "s/;env\[PATH\]/env\[PATH\]/g" /etc/php7/php-fpm.d/www.conf \
|
||||
&& apk del ${BUILD_DEPS} php7-dev php7-pear \
|
||||
&& rm /etc/php7/conf.d/apcu.ini \
|
||||
&& apk del ${BUILD_DEPS} \
|
||||
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
@ -83,11 +69,10 @@ COPY cron /etc/periodic/15min/nextcloud
|
||||
RUN chmod +x /usr/local/bin/run.sh /etc/periodic/15min/nextcloud
|
||||
|
||||
VOLUME /data /config /apps2
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
LABEL description="A server software for creating file hosting services" \
|
||||
nextcloud="Nextcloud v${NEXTCLOUD_VERSION}" \
|
||||
apcu="apcu v${APCU_VERSION}" \
|
||||
apcu_bc="apcu_bc v${APCUBC_VERSION}"
|
||||
nextcloud="Nextcloud v${NEXTCLOUD_VERSION}"
|
||||
|
||||
CMD ["/sbin/tini","--","run.sh"]
|
||||
|
@ -1,6 +1,4 @@
|
||||
extension=apcu.so
|
||||
extension=apc.so
|
||||
apc.enabled=1
|
||||
apc.enable_cli=1
|
||||
apc.shm_size=256M
|
||||
apc.shm_size=128M
|
||||
apc.ttl=7200
|
||||
|
@ -2,7 +2,7 @@ zend_extension=opcache.so
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.fast_shutdown=1
|
||||
opcache.memory_consumption=256
|
||||
opcache.memory_consumption=128
|
||||
opcache.interned_strings_buffer=16
|
||||
opcache.max_accelerated_files=5413
|
||||
opcache.revalidate_freq=60
|
||||
|
@ -14,3 +14,4 @@ pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
chdir = /
|
||||
request_terminate_timeout = 300
|
||||
env[PATH] = /usr/local/bin:/usr/bin:/bin
|
||||
|
Loading…
x
Reference in New Issue
Block a user