diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 65 |
1 files changed, 38 insertions, 27 deletions
@@ -1,50 +1,61 @@ | |||
1 | # Stage 1: | 1 | # Stage 1: |
2 | # - Get Shaarli sources | 2 | # - Copy Shaarli sources |
3 | # - Build documentation | 3 | # - Build documentation |
4 | FROM dalibo/pandocker:stable as docs | 4 | FROM python:3-alpine as docs |
5 | ADD . /pandoc/shaarli | 5 | ADD . /usr/src/app/shaarli |
6 | RUN cd /pandoc/shaarli \ | 6 | RUN cd /usr/src/app/shaarli \ |
7 | && make htmldoc \ | 7 | && pip install --no-cache-dir mkdocs \ |
8 | && rm -rf .git | 8 | && mkdocs build |
9 | 9 | ||
10 | # Stage 2: | 10 | # Stage 2: |
11 | # - Resolve PHP dependencies with Composer | 11 | # - Resolve PHP dependencies with Composer |
12 | FROM composer:latest as composer | 12 | FROM composer:latest as composer |
13 | COPY --from=docs /pandoc/shaarli /app/shaarli | 13 | COPY --from=docs /usr/src/app/shaarli /app/shaarli |
14 | RUN cd shaarli \ | 14 | RUN cd shaarli \ |
15 | && composer --prefer-dist --no-dev install | 15 | && composer --prefer-dist --no-dev install |
16 | 16 | ||
17 | # Stage 3: | 17 | # Stage 3: |
18 | # - Shaarli image | 18 | # - Shaarli image |
19 | FROM debian:jessie | 19 | FROM alpine:3.6 |
20 | LABEL maintainer="Shaarli Community" | 20 | LABEL maintainer="Shaarli Community" |
21 | 21 | ||
22 | ENV TERM dumb | 22 | RUN apk --update --no-cache add \ |
23 | RUN apt-get update \ | 23 | ca-certificates \ |
24 | && apt-get install --no-install-recommends -y \ | 24 | nginx \ |
25 | ca-certificates \ | 25 | php7 \ |
26 | curl \ | 26 | php7-ctype \ |
27 | nginx-light \ | 27 | php7-curl \ |
28 | php5-curl \ | 28 | php7-fpm \ |
29 | php5-fpm \ | 29 | php7-gd \ |
30 | php5-gd \ | 30 | php7-iconv \ |
31 | php5-intl \ | 31 | php7-intl \ |
32 | supervisor \ | 32 | php7-json \ |
33 | && apt-get clean | 33 | php7-mbstring \ |
34 | 34 | php7-openssl \ | |
35 | RUN sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php5/fpm/php.ini \ | 35 | php7-session \ |
36 | && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php5/fpm/php.ini | 36 | php7-xml \ |
37 | php7-zlib \ | ||
38 | s6 | ||
37 | 39 | ||
38 | COPY .docker/nginx.conf /etc/nginx/nginx.conf | 40 | COPY .docker/nginx.conf /etc/nginx/nginx.conf |
39 | COPY .docker/supervised.conf /etc/supervisor/conf.d/supervised.conf | 41 | COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf |
42 | COPY .docker/services.d /etc/services.d | ||
43 | |||
44 | RUN rm -rf /etc/php7/php-fpm.d/www.conf \ | ||
45 | && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ | ||
46 | && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini | ||
47 | |||
40 | 48 | ||
41 | WORKDIR /var/www | 49 | WORKDIR /var/www |
42 | COPY --from=composer /app/shaarli shaarli | 50 | COPY --from=composer /app/shaarli shaarli |
43 | RUN rm -rf html \ | 51 | |
44 | && chown -R www-data:www-data . | 52 | RUN chown -R nginx:nginx . \ |
53 | && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ | ||
54 | && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log | ||
45 | 55 | ||
46 | VOLUME /var/www/shaarli/data | 56 | VOLUME /var/www/shaarli/data |
47 | 57 | ||
48 | EXPOSE 80 | 58 | EXPOSE 80 |
49 | 59 | ||
50 | CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] | 60 | ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"] |
61 | CMD [] | ||