]> git.immae.eu Git - github/shaarli/Shaarli.git/blob - docker/alpine/Dockerfile.master
docker: introduce multi-stage image build (master, latest)
[github/shaarli/Shaarli.git] / docker / alpine / Dockerfile.master
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
12 FROM alpine:3.6
13 LABEL maintainer="Shaarli Community"
14
15 RUN apk --update --no-cache add \
16 ca-certificates \
17 nginx \
18 php7 \
19 php7-ctype \
20 php7-curl \
21 php7-fpm \
22 php7-gd \
23 php7-iconv \
24 php7-intl \
25 php7-json \
26 php7-mbstring \
27 php7-openssl \
28 php7-session \
29 php7-xml \
30 php7-zlib \
31 s6
32
33 COPY nginx.conf /etc/nginx/nginx.conf
34 COPY php-fpm.conf /etc/php7/php-fpm.conf
35 COPY services.d /etc/services.d
36
37 RUN rm -rf /etc/php7/php-fpm.d/www.conf \
38 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
39 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
40
41
42 WORKDIR /var/www
43 COPY --from=composer /app/shaarli shaarli
44
45 RUN chown -R nginx:nginx .
46 VOLUME /var/www/shaarli/data
47
48 EXPOSE 80
49
50 ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
51 CMD []