aboutsummaryrefslogtreecommitdiffhomepage
path: root/Dockerfile
blob: e80670315e913b9e48c74116f9fb0947ad8ac701 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Stage 1:
# - Get Shaarli sources
# - Build documentation
FROM dalibo/pandocker:stable as docs
ADD . /pandoc/shaarli
RUN cd /pandoc/shaarli \
    && make htmldoc \
    && rm -rf .git

# Stage 2:
# - Resolve PHP dependencies with Composer
FROM composer:latest as composer
COPY --from=docs /pandoc/shaarli /app/shaarli
RUN cd shaarli \
    && composer --prefer-dist --no-dev install

# Stage 3:
# - Shaarli image
FROM debian:jessie
LABEL maintainer="Shaarli Community"

ENV TERM dumb
RUN apt-get update \
    && apt-get install --no-install-recommends -y \
       ca-certificates \
       curl \
       nginx-light \
       php5-curl \
       php5-fpm \
       php5-gd \
       php5-intl \
       supervisor \
    && apt-get clean

RUN sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php5/fpm/php.ini \
    && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php5/fpm/php.ini

COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY .docker/supervised.conf /etc/supervisor/conf.d/supervised.conf

WORKDIR /var/www
COPY --from=composer /app/shaarli shaarli
RUN rm -rf html \
    && chown -R www-data:www-data .

VOLUME /var/www/shaarli/data

EXPOSE 80

CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]