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 && apk add --no-cache gcc musl-dev \
8 && pip install --no-cache-dir mkdocs \
9 && mkdocs build --clean
12 # - Resolve PHP dependencies with Composer
13 FROM composer:latest as composer
14 COPY --from=docs /usr/src/app/shaarli /app/shaarli
16 && composer --prefer-dist --no-dev install
19 # - Frontend dependencies
20 FROM node:12-alpine as node
21 COPY --from=composer /app/shaarli shaarli
25 && rm -rf node_modules
30 LABEL maintainer="Shaarli Community"
32 RUN apk --update --no-cache add \
50 COPY .docker/nginx.conf /etc/nginx/nginx.conf
51 COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
52 COPY .docker/services.d /etc/services.d
54 RUN rm -rf /etc/php7/php-fpm.d/www.conf \
55 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
56 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
60 COPY --from=node /shaarli shaarli
62 RUN chown -R nginx:nginx . \
63 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
64 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
66 VOLUME /var/www/shaarli/cache
67 VOLUME /var/www/shaarli/data
71 ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]