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