From a7e1e8f87eef0df4393025b77466303185acb85e Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 29 Jan 2018 22:07:48 +0100 Subject: [PATCH] start of next version --- Dockerfile | 45 +++---------------- .../etc/confd/templates/nextcloud.conf.tmpl | 31 ++++++------- .../00-nextcloud | 0 rootfs/var/spool/cron/crontabs/nginx | 2 +- 4 files changed, 20 insertions(+), 58 deletions(-) rename rootfs/etc/{cont-init.d => cont-init.d.stop}/00-nextcloud (100%) diff --git a/Dockerfile b/Dockerfile index 48d4d9f..e4ef339 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,55 +1,20 @@ -FROM quay.io/thallian/php7-fpm:latest +FROM registry.gitlab.com/thallian/docker-php7-fpm:master ENV FPMUSER nginx ENV FPMGROUP nginx -ENV VERSION 12.0.0 - RUN apk add --no-cache \ - libressl \ - tar \ nginx \ postgresql-client \ - php7 \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-gd \ - php7-iconv \ - php7-json \ - php7-xml \ - php7-xmlreader \ - php7-xmlwriter \ - php7-zlib \ - php7-zip \ - php7-pgsql \ - php7-pdo_pgsql \ - php7-openssl \ - php7-ftp \ - php7-session \ - php7-mbstring \ - php7-posix \ - php7-pcntl \ - php7-mcrypt \ - php7-bz2 \ - php7-exif \ - php7-apcu \ - php7-ldap \ - php7-simplexml \ - php7-fileinfo \ - php7-opcache - -RUN mkdir /var/lib/nextcloud -RUN wget -qO- https://download.nextcloud.com/server/releases/nextcloud-$VERSION.tar.bz2 | tar xj -C /var/lib/nextcloud --strip 1 - -WORKDIR /var/lib/nextcloud/ + nextcloud \ + nextcloud-user_ldap \ + nextcloud-pgsql RUN chown -R nginx:nginx /var/lib/nextcloud -RUN chmod +x /var/lib/nextcloud/occ +RUN chown -R nginx:nginx /usr/share/webapps/nextcloud RUN mkdir /run/nginx -RUN apk del tar ADD /rootfs / VOLUME /var/lib/nextcloud/data diff --git a/rootfs/etc/confd/templates/nextcloud.conf.tmpl b/rootfs/etc/confd/templates/nextcloud.conf.tmpl index fa42fcc..3f594be 100644 --- a/rootfs/etc/confd/templates/nextcloud.conf.tmpl +++ b/rootfs/etc/confd/templates/nextcloud.conf.tmpl @@ -8,13 +8,12 @@ server { server_name {{getenv "DOMAIN"}}; add_header X-Content-Type-Options nosniff; - add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; - root /var/lib/nextcloud/; + root /usr/share/webapps/nextcloud/; location = /robots.txt { allow all; @@ -29,14 +28,16 @@ server { location = /.well-known/caldav { return 301 $scheme://$host/remote.php/dav; } - - location /.well-known/acme-challenge { } - + client_max_body_size {{getenv "MAX_UPLOAD_SIZE"}}; fastcgi_buffers 64 4K; - - error_page 403 /core/templates/403.php; - error_page 404 /core/templates/404.php; + + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; location / { rewrite ^ /index.php$uri; @@ -45,14 +46,13 @@ server { location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { deny all; } - location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } - location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) { + location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { + fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; - fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param HTTPS on; @@ -70,21 +70,18 @@ server { index index.php; } - location ~* \.(?:css|js)$ { + location ~ \.(?:css|js|woff|svg|gif)$ { try_files $uri /index.php$uri$is_args$args; - add_header Cache-Control "public, max-age=7200"; + add_header Cache-Control "public, max-age=15778463"; add_header X-Content-Type-Options nosniff; - add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; - - # Optional: Don't log access to assets access_log off; } - location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ { + location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ { try_files $uri /index.php$uri$is_args$args; access_log off; } diff --git a/rootfs/etc/cont-init.d/00-nextcloud b/rootfs/etc/cont-init.d.stop/00-nextcloud similarity index 100% rename from rootfs/etc/cont-init.d/00-nextcloud rename to rootfs/etc/cont-init.d.stop/00-nextcloud diff --git a/rootfs/var/spool/cron/crontabs/nginx b/rootfs/var/spool/cron/crontabs/nginx index 4fa2c27..2ab2020 100644 --- a/rootfs/var/spool/cron/crontabs/nginx +++ b/rootfs/var/spool/cron/crontabs/nginx @@ -1 +1 @@ -*/15 * * * * php -f /var/lib/nextcloud/cron.php \ No newline at end of file +*/15 * * * * php -f /usr/share/webapps/nextcloud/cron.php \ No newline at end of file