From 35927142d7440f6a7c360e53b2beb3a6834835f0 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 16 Jun 2018 23:08:26 +0200 Subject: docker: build the image from the local sources Relates to https://github.com/shaarli/Shaarli/issues/1153 Signed-off-by: VirtualTam --- Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5e03814c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +# Stage 1: +# - Get Shaarli sources +# - Resolve PHP dependencies with Composer +FROM composer:latest as composer +ADD . /app/shaarli +RUN cd shaarli \ + && composer --prefer-dist --no-dev install + +# Stage 2: +# - Shaarli image +FROM debian:jessie +LABEL maintainer="Shaarli Community" + +ENV TERM dumb +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + ca-certificates \ + curl \ + nginx-light \ + php5-curl \ + php5-fpm \ + php5-gd \ + php5-intl \ + supervisor \ + && apt-get clean + +RUN sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php5/fpm/php.ini \ + && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php5/fpm/php.ini + +COPY .docker/nginx.conf /etc/nginx/nginx.conf +COPY .docker/supervised.conf /etc/supervisor/conf.d/supervised.conf + +WORKDIR /var/www +COPY --from=composer /app/shaarli shaarli +RUN rm -rf html \ + && chown -R www-data:www-data . + +VOLUME /var/www/shaarli/data + +EXPOSE 80 + +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] -- cgit v1.2.3 From 754ee049fb090ba2f212a3beab6c452aaefeb8fd Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sun, 17 Jun 2018 13:00:03 +0200 Subject: docker: generate the HTML documentation Relates to https://github.com/shaarli/Shaarli/issues/1153 Signed-off-by: VirtualTam --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 5e03814c..e8067031 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,20 @@ # Stage 1: # - Get Shaarli sources +# - Build documentation +FROM dalibo/pandocker:stable as docs +ADD . /pandoc/shaarli +RUN cd /pandoc/shaarli \ + && make htmldoc \ + && rm -rf .git + +# Stage 2: # - Resolve PHP dependencies with Composer FROM composer:latest as composer -ADD . /app/shaarli +COPY --from=docs /pandoc/shaarli /app/shaarli RUN cd shaarli \ && composer --prefer-dist --no-dev install -# Stage 2: +# Stage 3: # - Shaarli image FROM debian:jessie LABEL maintainer="Shaarli Community" -- cgit v1.2.3