From 90f12b12ca9a828e2aaf2535c09ec9c73ff1e2a6 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Fri, 12 Aug 2016 21:36:54 +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 See https://github.com/shaarli/Shaarli/wiki/Server-requirements Modifications: - [all][env] set $TERM=dumb to avoid debconf-related issues - [all][pkg] install ca-certificates - [all][pkg] cleanup APT cache after installing packages - [dev] refactor Dockerfile - [prod][master] refactor Dockerfile - [prod][master][php] use Composer to resolve PHP dependencies Signed-off-by: VirtualTam --- docker/development/Dockerfile | 30 +++++++++++++++++++----------- docker/production/Dockerfile | 23 +++++++++++++++++++---- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index 2ed59b89..0c19b085 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -1,26 +1,34 @@ FROM debian:jessie MAINTAINER Shaarli Community +ENV TERM dumb RUN apt-get update \ - && apt-get install -y \ - nginx-light php5-fpm php5-gd supervisor \ - git nano - -ADD https://getcomposer.org/composer.phar /usr/local/bin/composer -RUN chmod 755 /usr/local/bin/composer + && apt-get install --no-install-recommends -y \ + ca-certificates \ + nginx-light \ + php5-curl \ + php5-fpm \ + php5-gd \ + php5-intl \ + supervisor \ + git \ + nano \ + && apt-get clean COPY nginx.conf /etc/nginx/nginx.conf COPY supervised.conf /etc/supervisor/conf.d/supervised.conf -RUN echo "" > /var/www/index.php + +ADD https://getcomposer.org/composer.phar /usr/local/bin/composer +RUN chmod 755 /usr/local/bin/composer WORKDIR /var/www +RUN git clone https://github.com/shaarli/Shaarli.git shaarli \ + && cd shaarli \ + && composer --prefer-dist install RUN rm -rf html \ - && git clone https://github.com/shaarli/Shaarli.git shaarli \ + && echo "" > index.php \ && chown -R www-data:www-data . -WORKDIR /var/www/shaarli -RUN composer install - VOLUME /var/www/shaarli/data EXPOSE 80 diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 3db4eb56..d93ed262 100644 --- a/docker/production/Dockerfile +++ b/docker/production/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 rm -rf html \ - && curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xvzf - \ +RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ && mv Shaarli-master shaarli \ - && chown -R www-data:www-data shaarli + && cd shaarli \ + && composer --prefer-dist --no-dev install +RUN rm -rf html \ + && chown -R www-data:www-data . VOLUME /var/www/shaarli/data -- cgit v1.2.3