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