]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - Dockerfile
Merge tag 'v0.10.0' into latest
[github/shaarli/Shaarli.git] / Dockerfile
CommitLineData
decae8c1
V
1# Stage 1:
2# - Copy Shaarli sources
3# - Build documentation
4FROM python:3-alpine as docs
5ADD . /usr/src/app/shaarli
6RUN cd /usr/src/app/shaarli \
7 && pip install --no-cache-dir mkdocs \
7982c3ff 8<<<<<<< HEAD
decae8c1 9 && mkdocs build
7982c3ff 10=======
fd2e8fad 11 && mkdocs build --clean
7982c3ff 12>>>>>>> v0.10.0
decae8c1
V
13
14# Stage 2:
15# - Resolve PHP dependencies with Composer
16FROM composer:latest as composer
17COPY --from=docs /usr/src/app/shaarli /app/shaarli
18RUN cd shaarli \
19 && composer --prefer-dist --no-dev install
20
21# Stage 3:
94abe0a6
A
22# - Frontend dependencies
23FROM node:9.9-alpine as node
24COPY --from=composer /app/shaarli shaarli
25RUN cd shaarli \
26 && yarn install \
27 && yarn run build \
28 && rm -rf node_modules
29
2a3fe990 30# Stage 4:
decae8c1 31# - Shaarli image
be53fa40 32FROM alpine:3.8
decae8c1
V
33LABEL maintainer="Shaarli Community"
34
35RUN apk --update --no-cache add \
36 ca-certificates \
37 nginx \
38 php7 \
39 php7-ctype \
40 php7-curl \
41 php7-fpm \
42 php7-gd \
43 php7-iconv \
44 php7-intl \
45 php7-json \
46 php7-mbstring \
47 php7-openssl \
48 php7-session \
49 php7-xml \
50 php7-zlib \
51 s6
52
53COPY .docker/nginx.conf /etc/nginx/nginx.conf
54COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
55COPY .docker/services.d /etc/services.d
56
57RUN rm -rf /etc/php7/php-fpm.d/www.conf \
58 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
59 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
60
61
62WORKDIR /var/www
94abe0a6 63COPY --from=node /shaarli shaarli
decae8c1
V
64
65RUN chown -R nginx:nginx . \
66 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
67 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
68
186d9eaa 69VOLUME /var/www/shaarli/cache
decae8c1
V
70VOLUME /var/www/shaarli/data
71
72EXPOSE 80
73
74ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
75CMD []