From 665279ec99d31c7d571f90bf0186edb268020bb8 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sun, 14 Aug 2016 16:20:06 +0200 Subject: Docker: update dependencies, introduce Composer Relates to https://github.com/shaarli/Shaarli/issues/607 Relates to https://github.com/shaarli/Shaarli/pull/612 Relates to https://github.com/shaarli/Shaarli/pull/624 Relates to https://github.com/shaarli/Shaarli/pull/633 See https://github.com/shaarli/Shaarli/wiki/Server-requirements Modifications: - [prod][stable] refactor Dockerfile - [prod][stable] set $TERM=dumb to avoid debconf-related issues - [prod][stable] install ca-certificates - [prod][stable] cleanup APT cache after installing packages - [prod][stable] use Composer to resolve PHP dependencies Signed-off-by: VirtualTam --- docker/production/stable/Dockerfile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'docker/production/stable') diff --git a/docker/production/stable/Dockerfile b/docker/production/stable/Dockerfile index 2bb3948c..178d1cef 100644 --- a/docker/production/stable/Dockerfile +++ b/docker/production/stable/Dockerfile @@ -1,17 +1,32 @@ FROM debian:jessie MAINTAINER Shaarli Community +ENV TERM dumb RUN apt-get update \ - && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor + && apt-get install --no-install-recommends -y \ + ca-certificates \ + curl \ + nginx-light \ + php5-curl \ + php5-fpm \ + php5-gd \ + php5-intl \ + supervisor \ + && apt-get clean COPY nginx.conf /etc/nginx/nginx.conf COPY supervised.conf /etc/supervisor/conf.d/supervised.conf +ADD https://getcomposer.org/composer.phar /usr/local/bin/composer +RUN chmod 755 /usr/local/bin/composer + WORKDIR /var/www +RUN curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xzf - \ + && mv Shaarli-stable shaarli + && cd shaarli \ + && composer --prefer-dist --no-dev install RUN rm -rf html \ - && curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xvzf - \ - && mv Shaarli-stable shaarli \ - && chown -R www-data:www-data shaarli + && chown -R www-data:www-data . VOLUME /var/www/shaarli/data -- cgit v1.2.3 From 7329118e9cfb41e4db0d898183304fcb0b204f7b Mon Sep 17 00:00:00 2001 From: Gary Marigliano Date: Wed, 14 Sep 2016 11:08:11 +0200 Subject: Add a missing backslash in stable Dockerfile version --- docker/production/stable/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docker/production/stable') diff --git a/docker/production/stable/Dockerfile b/docker/production/stable/Dockerfile index 178d1cef..a509fda6 100644 --- a/docker/production/stable/Dockerfile +++ b/docker/production/stable/Dockerfile @@ -22,7 +22,7 @@ RUN chmod 755 /usr/local/bin/composer WORKDIR /var/www RUN curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xzf - \ - && mv Shaarli-stable shaarli + && mv Shaarli-stable shaarli \ && cd shaarli \ && composer --prefer-dist --no-dev install RUN rm -rf html \ -- cgit v1.2.3 From b7f8b874bb9f2028c29b1f22f893fabec2836de8 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 5 Nov 2016 19:51:03 +0100 Subject: Docker: set favicon location in nginx configuration Relates to https://github.com/shaarli/Shaarli/issues/681 Fixed: - nginx: set the favicon location See http://serverfault.com/a/352861 Signed-off-by: VirtualTam --- docker/production/stable/nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docker/production/stable') diff --git a/docker/production/stable/nginx.conf b/docker/production/stable/nginx.conf index e23c4587..f7d59fc8 100644 --- a/docker/production/stable/nginx.conf +++ b/docker/production/stable/nginx.conf @@ -41,6 +41,11 @@ http { add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } + location = /favicon.ico { + # serve the Shaarli favicon from its custom location + alias /var/www/shaarli/images/favicon.ico; + } + location ~ (index)\.php$ { # filter and proxy PHP requests to PHP-FPM fastcgi_pass unix:/var/run/php5-fpm.sock; -- cgit v1.2.3 From 68579ad5c4d1978366c5d2be2ef34da6a3618ef0 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 5 Nov 2016 20:42:54 +0100 Subject: Docker: increase maximum file upload size to 10 MiB Relates to https://github.com/shaarli/Shaarli/issues/681 Changed: - nginx+php-fpm: set maximum upload size to 10 MiB See: - https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size - https://secure.php.net/manual/en/ini.core.php#ini.post-max-size - https://secure.php.net/manual/en/ini.core.php#ini.upload-max-filesize Signed-off-by: VirtualTam --- docker/production/stable/Dockerfile | 2 ++ docker/production/stable/nginx.conf | 2 ++ 2 files changed, 4 insertions(+) (limited to 'docker/production/stable') diff --git a/docker/production/stable/Dockerfile b/docker/production/stable/Dockerfile index a509fda6..fc9588b0 100644 --- a/docker/production/stable/Dockerfile +++ b/docker/production/stable/Dockerfile @@ -14,6 +14,8 @@ RUN apt-get update \ supervisor \ && apt-get clean +RUN sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php5/fpm/php.ini +RUN sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php5/fpm/php.ini COPY nginx.conf /etc/nginx/nginx.conf COPY supervised.conf /etc/supervisor/conf.d/supervised.conf diff --git a/docker/production/stable/nginx.conf b/docker/production/stable/nginx.conf index f7d59fc8..5ffa02d0 100644 --- a/docker/production/stable/nginx.conf +++ b/docker/production/stable/nginx.conf @@ -11,6 +11,8 @@ http { default_type application/octet-stream; keepalive_timeout 20; + client_max_body_size 10m; + index index.html index.php; server { -- cgit v1.2.3