diff --git a/Dockerfile b/Dockerfile index 9278e535..3419a7af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ FROM lsiobase/alpine.nginx MAINTAINER sparklyballs -# set paths -ENV WWW_ROOT="/config/www" -ENV NEXTCLOUD_PATH="${WWW_ROOT}/nextcloud" +# package version +ENV NEXTCLOUD_VER="9.0.53" + +# environment settings +ENV NEXTCLOUD_PATH="/config/www/nextcloud" # install build-dependencies RUN \ @@ -19,25 +21,7 @@ RUN \ samba-dev \ zlib-dev && \ -# fetch php smbclient source - git clone git://github.com/eduardok/libsmbclient-php.git /tmp/smbclient && \ - -# compile smbclient - cd /tmp/smbclient && \ - phpize && \ - ./configure && \ - make && \ - make install && \ - -# uninstall build-dependencies - apk del --purge \ - build-dependencies && \ - -# cleanup - rm -rfv /tmp/* - # install runtime packages -RUN \ apk add --no-cache \ curl \ ffmpeg \ @@ -72,26 +56,39 @@ RUN \ sudo \ tar \ unzip && \ - apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/testing \ - php5-memcached -# configure php extensions -RUN \ - echo "extension="smbclient.so"" >> /etc/php5/php.ini + apk add --no-cache \ + --repository http://nl.alpinelinux.org/alpine/edge/testing \ + php5-memcached && \ -# configure php for nextcloud -RUN \ +# fetch php smbclient source + git clone git://github.com/eduardok/libsmbclient-php.git /tmp/smbclient && \ + +# compile smbclient + cd /tmp/smbclient && \ + phpize && \ + ./configure && \ + make && \ + make install && \ + +# uninstall build-dependencies + apk del --purge \ + build-dependencies && \ + +# configure php and nginx for nextcloud + echo "extension="smbclient.so"" >> /etc/php5/php.ini && \ sed -i \ 's/;always_populate_raw_post_data = -1/always_populate_raw_post_data = -1/g' \ /etc/php5/php.ini && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /defaults/nginx-fpm.conf + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /defaults/nginx-fpm.conf && \ + +# cleanup + rm -rf \ + /tmp/* -# add local files +# copy local files COPY root/ / # ports and volumes -VOLUME /config /data EXPOSE 443 - -# set nextcloud version -ENV NEXTCLOUD_VER="9.0.53" +VOLUME /config /data diff --git a/README.md b/README.md index 6315b10f..50feba20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ -![https://linuxserver.io](http://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) +![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) + +## This is a Container in active development by the [LinuxServer.io](https://linuxserver.io) team and is not recommended for use by the general public. + +If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general, check out the following. + +* [forum.linuxserver.io](https://forum.linuxserver.io) +* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` +* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! -## This is a Container in active development, and should not be used by the general public. -If you are curious about the current progress or want to comment\contribute to this work, feel free to join us at our irc channel: -[IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` or visit our website at [https://linuxserver.io](https://www.linuxserver.io/). diff --git a/root/etc/cont-init.d/40-config b/root/etc/cont-init.d/40-config index 64821298..4deb6b20 100644 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/cont-init.d/40-config @@ -1,8 +1,8 @@ #!/usr/bin/with-contenv bash # permissions -chown abc:abc /config /data -chown -R abc:abc /var/lib/nginx - -# set cronjob -crontab /defaults/nextcloud +chown abc:abc \ + /config \ + /data +chown -R abc:abc \ + /var/lib/nginx diff --git a/root/etc/cont-init.d/50-install b/root/etc/cont-init.d/50-install index 20bb0f48..c0e87952 100644 --- a/root/etc/cont-init.d/50-install +++ b/root/etc/cont-init.d/50-install @@ -1,14 +1,20 @@ #!/usr/bin/with-contenv bash -mkdir -p "${WWW_ROOT}" -chown abc:abc "${WWW_ROOT}" +# create folders +mkdir -p \ + "${NEXTCLOUD_PATH}" +# install app if [ ! -e "${NEXTCLOUD_PATH}/index.php" ]; then -curl -o /tmp/nextcloud.zip -L \ -https://download.nextcloud.com/server/releases/nextcloud-"${NEXTCLOUD_VER}".zip -cd /tmp || true -unzip nextcloud.zip -mv /tmp/nextcloud "${NEXTCLOUD_PATH}" -rm -f /tmp/nextcloud.zip -chown abc:abc -R "${NEXTCLOUD_PATH}" +curl -o /tmp/nextcloud.tar.bz2 -L \ + https://download.nextcloud.com/server/releases/nextcloud-"${NEXTCLOUD_VER}".tar.bz2 +tar xf /tmp/nextcloud.tar.bz2 -C \ + "${NEXTCLOUD_PATH}" --strip-components=1 +rm -f \ + /tmp/nextcloud.tar.bz2 +chown abc:abc -R \ + "${NEXTCLOUD_PATH}" fi + +# set cronjob +crontab /defaults/nextcloud diff --git a/root/etc/cont-init.d/60-memcache b/root/etc/cont-init.d/60-memcache index 2a070959..10697d7f 100644 --- a/root/etc/cont-init.d/60-memcache +++ b/root/etc/cont-init.d/60-memcache @@ -1,5 +1,9 @@ #!/usr/bin/with-contenv bash -[[ ! -f /config/www/nextcloud/config/config.php ]] && cp /defaults/config.php /config/www/nextcloud/config/config.php +# copy config +[[ ! -f /config/www/nextcloud/config/config.php ]] && \ + cp /defaults/config.php /config/www/nextcloud/config/config.php -chown abc:abc /config/www/nextcloud/config/config.php +# permissions +chown abc:abc \ + /config/www/nextcloud/config/config.php