diff options
-rw-r--r-- | Dockerfile.armhf | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 5dcc34aa..1185e2df 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf | |||
@@ -1,9 +1,38 @@ | |||
1 | FROM lsiobase/alpine.armhf:3.6 | 1 | # Stage 1: |
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 | ||
10 | |||
11 | # Stage 2: | ||
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-mbstring composer \ | ||
16 | && cd /app/shaarli \ | ||
17 | && composer --prefer-dist --no-dev install | ||
18 | |||
19 | # Stage 3: | ||
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 \ | ||
24 | && cd /shaarli \ | ||
25 | && yarn install \ | ||
26 | && yarn run build \ | ||
27 | && rm -rf node_modules | ||
28 | |||
29 | # Stage 4: | ||
30 | # - Shaarli image | ||
31 | FROM arm32v6/alpine:3.8 | ||
2 | LABEL maintainer="Shaarli Community" | 32 | LABEL maintainer="Shaarli Community" |
3 | 33 | ||
4 | RUN apk --update --no-cache add \ | 34 | RUN apk --update --no-cache add \ |
5 | ca-certificates \ | 35 | ca-certificates \ |
6 | curl \ | ||
7 | nginx \ | 36 | nginx \ |
8 | php7 \ | 37 | php7 \ |
9 | php7-ctype \ | 38 | php7-ctype \ |
@@ -15,7 +44,6 @@ RUN apk --update --no-cache add \ | |||
15 | php7-json \ | 44 | php7-json \ |
16 | php7-mbstring \ | 45 | php7-mbstring \ |
17 | php7-openssl \ | 46 | php7-openssl \ |
18 | php7-phar \ | ||
19 | php7-session \ | 47 | php7-session \ |
20 | php7-xml \ | 48 | php7-xml \ |
21 | php7-zlib \ | 49 | php7-zlib \ |
@@ -25,22 +53,19 @@ COPY .docker/nginx.conf /etc/nginx/nginx.conf | |||
25 | COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf | 53 | COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf |
26 | COPY .docker/services.d /etc/services.d | 54 | COPY .docker/services.d /etc/services.d |
27 | 55 | ||
28 | RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \ | 56 | RUN rm -rf /etc/php7/php-fpm.d/www.conf \ |
29 | && rm -rf /etc/php7/php-fpm.d/www.conf \ | ||
30 | && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ | 57 | && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ |
31 | && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini | 58 | && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini |
32 | 59 | ||
33 | 60 | ||
34 | WORKDIR /var/www | 61 | WORKDIR /var/www |
35 | RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ | 62 | COPY --from=node /shaarli /var/www/shaarli |
36 | && mv Shaarli-master shaarli \ | 63 | |
37 | && cd shaarli \ | 64 | RUN chown -R nginx:nginx . \ |
38 | && composer --prefer-dist --no-dev install \ | ||
39 | && rm -rf ~/.composer \ | ||
40 | && chown -R nginx:nginx . \ | ||
41 | && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ | 65 | && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \ |
42 | && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log | 66 | && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log |
43 | 67 | ||
68 | VOLUME /var/www/shaarli/cache | ||
44 | VOLUME /var/www/shaarli/data | 69 | VOLUME /var/www/shaarli/data |
45 | 70 | ||
46 | EXPOSE 80 | 71 | EXPOSE 80 |