diff options
Diffstat (limited to 'docker/alpine/Dockerfile.master')
-rw-r--r-- | docker/alpine/Dockerfile.master | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/docker/alpine/Dockerfile.master b/docker/alpine/Dockerfile.master index 58f7c6e7..9cb4dec4 100644 --- a/docker/alpine/Dockerfile.master +++ b/docker/alpine/Dockerfile.master | |||
@@ -1,9 +1,19 @@ | |||
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: | ||
11 | # - Shaarli image | ||
1 | FROM alpine:3.6 | 12 | FROM alpine:3.6 |
2 | MAINTAINER Shaarli Community | 13 | LABEL maintainer="Shaarli Community" |
3 | 14 | ||
4 | RUN apk --update --no-cache add \ | 15 | RUN apk --update --no-cache add \ |
5 | ca-certificates \ | 16 | ca-certificates \ |
6 | curl \ | ||
7 | nginx \ | 17 | nginx \ |
8 | php7 \ | 18 | php7 \ |
9 | php7-ctype \ | 19 | php7-ctype \ |
@@ -15,7 +25,6 @@ RUN apk --update --no-cache add \ | |||
15 | php7-json \ | 25 | php7-json \ |
16 | php7-mbstring \ | 26 | php7-mbstring \ |
17 | php7-openssl \ | 27 | php7-openssl \ |
18 | php7-phar \ | ||
19 | php7-session \ | 28 | php7-session \ |
20 | php7-xml \ | 29 | php7-xml \ |
21 | php7-zlib \ | 30 | php7-zlib \ |
@@ -25,20 +34,15 @@ COPY nginx.conf /etc/nginx/nginx.conf | |||
25 | COPY php-fpm.conf /etc/php7/php-fpm.conf | 34 | COPY php-fpm.conf /etc/php7/php-fpm.conf |
26 | COPY services.d /etc/services.d | 35 | COPY services.d /etc/services.d |
27 | 36 | ||
28 | RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \ | 37 | 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 \ | 38 | && 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 | 39 | && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini |
32 | 40 | ||
33 | 41 | ||
34 | WORKDIR /var/www | 42 | WORKDIR /var/www |
35 | RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \ | 43 | COPY --from=composer /app/shaarli shaarli |
36 | && mv Shaarli-master shaarli \ | ||
37 | && cd shaarli \ | ||
38 | && composer --prefer-dist --no-dev install \ | ||
39 | && rm -rf ~/.composer \ | ||
40 | && chown -R nginx:nginx . | ||
41 | 44 | ||
45 | RUN chown -R nginx:nginx . | ||
42 | VOLUME /var/www/shaarli/data | 46 | VOLUME /var/www/shaarli/data |
43 | 47 | ||
44 | EXPOSE 80 | 48 | EXPOSE 80 |