2 # - Copy Shaarli sources
3 # - Build documentation
4 FROM python:3-alpine as docs
5 ADD . /usr/src/app/shaarli
6 RUN cd /usr/src/app/shaarli \
7 && pip install --no-cache-dir mkdocs \
8 && mkdocs build --clean
11 # - Resolve PHP dependencies with Composer
12 FROM composer:latest as composer
13 COPY --from=docs /usr/src/app/shaarli /app/shaarli
15 && composer --prefer-dist --no-dev install
18 # - Frontend dependencies
19 FROM node:9.9-alpine as node
20 COPY --from=composer /app/shaarli shaarli
24 && rm -rf node_modules
29 LABEL maintainer="Shaarli Community"
31 RUN apk --update --no-cache add \
49 COPY .docker/nginx.conf /etc/nginx/nginx.conf
50 COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
51 COPY .docker/services.d /etc/services.d
53 RUN rm -rf /etc/php7/php-fpm.d/www.conf \
54 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
55 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
59 COPY --from=node /shaarli shaarli
61 RUN chown -R nginx:nginx . \
62 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
63 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
65 VOLUME /var/www/shaarli/cache
66 VOLUME /var/www/shaarli/data
70 ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]