]>
Commit | Line | Data |
---|---|---|
3c51135f V |
1 | # Stage 1: |
2 | # - Get Shaarli sources | |
3 | # - Resolve PHP dependencies with Composer | |
4 | FROM composer:latest as composer | |
5 | RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ | |
6 | && mv Shaarli-master shaarli \ | |
7 | && cd shaarli \ | |
8 | && composer --prefer-dist --no-dev install | |
9 | ||
10 | # Stage 2: | |
94abe0a6 A |
11 | # - Frontend dependencies |
12 | FROM node:9.9-alpine as node | |
13 | COPY --from=composer /app/shaarli shaarli | |
14 | RUN cd shaarli \ | |
15 | && yarn install \ | |
16 | && yarn run build \ | |
17 | && rm -rf node_modules | |
18 | ||
19 | # Stage 3: | |
3c51135f | 20 | # - Shaarli image |
1a216fae | 21 | FROM alpine:3.6 |
3c51135f | 22 | LABEL maintainer="Shaarli Community" |
1a216fae V |
23 | |
24 | RUN apk --update --no-cache add \ | |
25 | ca-certificates \ | |
1a216fae V |
26 | nginx \ |
27 | php7 \ | |
28 | php7-ctype \ | |
29 | php7-curl \ | |
30 | php7-fpm \ | |
31 | php7-gd \ | |
32 | php7-iconv \ | |
33 | php7-intl \ | |
34 | php7-json \ | |
35 | php7-mbstring \ | |
36 | php7-openssl \ | |
1a216fae V |
37 | php7-session \ |
38 | php7-xml \ | |
39 | php7-zlib \ | |
40 | s6 | |
41 | ||
42 | COPY nginx.conf /etc/nginx/nginx.conf | |
43 | COPY php-fpm.conf /etc/php7/php-fpm.conf | |
44 | COPY services.d /etc/services.d | |
45 | ||
3c51135f | 46 | RUN rm -rf /etc/php7/php-fpm.d/www.conf \ |
1a216fae V |
47 | && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ |
48 | && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini | |
49 | ||
50 | ||
51 | WORKDIR /var/www | |
94abe0a6 | 52 | COPY --from=node /shaarli shaarli |
1a216fae | 53 | |
017baf57 A |
54 | RUN chown -R nginx:nginx . \ |
55 | && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ | |
56 | && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log | |
57 | ||
1a216fae V |
58 | VOLUME /var/www/shaarli/data |
59 | ||
60 | EXPOSE 80 | |
61 | ||
62 | ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"] | |
63 | CMD [] |