119 lines
4.4 KiB
Docker
Raw Normal View History

2016-11-25 18:19:08 +00:00
FROM alpine:edge
2017-01-16 18:56:55 +01:00
ARG NEXTCLOUD_VERSION=11.0.1
2017-02-15 17:59:45 +01:00
ARG GNU_LIBICONV_VERSION=1.15
2016-11-25 18:19:08 +00:00
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
ENV UID=991 GID=991 \
UPLOAD_MAX_SIZE=10G \
APC_SHM_SIZE=128M \
OPCACHE_MEM_SIZE=128 \
CRON_PERIOD=15m \
2017-02-15 15:12:09 +01:00
CRON_MEMORY_LIMIT=1g \
2016-11-25 18:19:08 +00:00
TZ=Etc/UTC \
DB_TYPE=sqlite3 \
2017-02-22 02:26:53 +01:00
DOMAIN=localhost
2016-11-25 18:19:08 +00:00
2017-02-22 20:22:57 +01:00
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
2016-11-25 18:19:08 +00:00
&& BUILD_DEPS=" \
gnupg \
tar \
build-base \
autoconf \
automake \
libtool \
samba-dev" \
2017-02-15 17:36:36 +01:00
&& apk -U upgrade && apk add \
2016-11-25 18:19:08 +00:00
${BUILD_DEPS} \
nginx \
s6 \
libressl \
ca-certificates \
libsmbclient \
samba-client \
su-exec \
tzdata \
2017-02-15 17:36:36 +01:00
php7.1@testing \
php7.1-fpm@testing \
php7.1-intl@testing \
php7.1-mbstring@testing \
php7.1-curl@testing \
php7.1-gd@testing \
php7.1-mcrypt@testing \
php7.1-opcache@testing \
php7.1-json@testing \
php7.1-session@testing \
php7.1-pdo@testing \
php7.1-dom@testing \
php7.1-ctype@testing \
php7.1-pdo_mysql@testing \
php7.1-pdo_pgsql@testing \
php7.1-pgsql@testing \
php7.1-pdo_sqlite@testing \
php7.1-sqlite3@testing \
php7.1-zlib@testing \
php7.1-zip@testing \
php7.1-xmlreader@testing \
php7.1-xml@testing \
php7.1-xmlwriter@testing \
php7.1-posix@testing \
php7.1-openssl@testing \
php7.1-ldap@testing \
php7.1-ftp@testing \
php7.1-pcntl@testing \
php7.1-exif@testing \
php7.1-pear@testing \
php7.1-dev@testing \
&& sed -i "$ s|\-n||g" /usr/bin/pecl && pecl install smbclient apcu redis \
2016-11-25 18:19:08 +00:00
&& 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} \
&& ./configure --prefix=/usr/local \
&& make && make install && libtool --finish /usr/local/lib && cd /tmp \
2017-02-15 17:36:36 +01:00
&& wget -q http://is1.php.net/get/php-7.1.1.tar.gz/from/this/mirror -O php7.1.tar.gz \
&& tar xzf php7.1.tar.gz && cd /tmp/php-7.1.1/ext/iconv && phpize7.1 \
&& ./configure --with-iconv=/usr/local --with-php-config=/usr/bin/php-config7.1 \
&& make && cp modules/iconv.so /usr/lib/php7.1/modules && cd /tmp \
&& echo "extension=iconv.so" > /etc/php7.1/conf.d/00_iconv.ini \
&& echo "extension=smbclient.so" > /etc/php7.1/conf.d/00_smbclient.ini \
2017-02-18 16:55:45 +01:00
&& echo "extension=redis.so" > /etc/php7.1/conf.d/redis.ini \
&& sed -i 's|;session.save_path = "/tmp"|session.save_path = "/data/session"|g' /etc/php7.1/php.ini \
2016-11-25 18:19:08 +00:00
&& mkdir /nextcloud \
&& NEXTCLOUD_TARBALL="nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
2016-12-13 22:32:00 +01:00
&& wget -q https://download.nextcloud.com/server/releases/${NEXTCLOUD_TARBALL} \
2017-02-23 12:29:33 +01:00
&& wget -q https://download.nextcloud.com/server/releases/${NEXTCLOUD_TARBALL}.sha512 \
2016-12-13 22:32:00 +01:00
&& wget -q https://download.nextcloud.com/server/releases/${NEXTCLOUD_TARBALL}.asc \
2016-11-25 18:19:08 +00:00
&& wget -q https://nextcloud.com/nextcloud.asc \
&& echo "Verifying both integrity and authenticity of ${NEXTCLOUD_TARBALL}..." \
2017-02-23 12:29:33 +01:00
&& CHECKSUM_STATE=$(echo -n $(sha512sum -c ${NEXTCLOUD_TARBALL}.sha512) | tail -c 2) \
2016-11-25 18:19:08 +00:00
&& if [ "${CHECKSUM_STATE}" != "OK" ]; then echo "Warning! Checksum does not match!" && exit 1; fi \
&& gpg --import nextcloud.asc \
&& FINGERPRINT="$(LANG=C gpg --verify ${NEXTCLOUD_TARBALL}.asc ${NEXTCLOUD_TARBALL} 2>&1 \
| sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \
&& if [ -z "${FINGERPRINT}" ]; then echo "Warning! Invalid GPG signature!" && exit 1; fi \
&& 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 \
2017-02-15 17:36:36 +01:00
&& apk del ${BUILD_DEPS} php7.1-pear php7.1-dev \
2016-11-25 18:19:08 +00:00
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
COPY nginx.conf /etc/nginx/nginx.conf
2017-02-15 17:36:36 +01:00
COPY php-fpm.conf /etc/php7.1/php-fpm.conf
COPY opcache.ini /etc/php7.1/conf.d/00_opcache.ini
COPY apcu.ini /etc/php7.1/conf.d/apcu.ini
2016-11-25 18:19:08 +00:00
COPY run.sh /usr/local/bin/run.sh
COPY setup.sh /usr/local/bin/setup.sh
COPY occ /usr/local/bin/occ
COPY s6.d /etc/s6.d
RUN chmod +x /usr/local/bin/* /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
2017-02-15 17:36:36 +01:00
VOLUME /data /config /apps2
2016-11-25 18:19:08 +00:00
EXPOSE 8888
LABEL description="A server software for creating file hosting services" \
2017-01-19 02:31:59 +01:00
nextcloud="Nextcloud v${NEXTCLOUD_VERSION}" \
maintainer="Wonderfall <wonderfall@targaryen.house>"
2016-11-25 18:19:08 +00:00
CMD ["run.sh"]