2 # - Copy Shaarli sources
3 # - Build documentation
4 FROM arm32v6/alpine:3.8 as docs
5 ADD . /usr/src/app/shaarli
6 RUN apk --update --no-cache add py2-pip \
7 && cd /usr/src/app/shaarli \
8 && pip install --no-cache-dir mkdocs \
9 && mkdocs build --clean
12 # - Resolve PHP dependencies with Composer
13 FROM arm32v6/alpine:3.8 as composer
14 COPY --from=docs /usr/src/app/shaarli /app/shaarli
15 RUN apk --update --no-cache add php7-curl php7-mbstring php7-simplexml composer \
17 && composer --prefer-dist --no-dev install
20 # - Frontend dependencies
21 FROM arm32v6/alpine:3.8 as node
22 COPY --from=composer /app/shaarli /shaarli
23 RUN apk --update --no-cache add yarn nodejs-current python2 build-base \
27 && rm -rf node_modules
31 FROM arm32v6/alpine:3.8
32 LABEL maintainer="Shaarli Community"
34 RUN apk --update --no-cache add \
52 COPY .docker/nginx.conf /etc/nginx/nginx.conf
53 COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
54 COPY .docker/services.d /etc/services.d
56 RUN rm -rf /etc/php7/php-fpm.d/www.conf \
57 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
58 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
62 COPY --from=node /shaarli /var/www/shaarli
64 RUN chown -R nginx:nginx . \
65 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
66 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
68 VOLUME /var/www/shaarli/cache
69 VOLUME /var/www/shaarli/data
73 ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]