aboutsummaryrefslogtreecommitdiffhomepage
path: root/Dockerfile
diff options
context:
space:
mode:
authorVirtualTam <virtualtam+github@flibidi.net>2018-06-20 16:29:27 +0200
committerGitHub <noreply@github.com>2018-06-20 16:29:27 +0200
commit5420c87e22570c8aface1dfe5fc1f54bd6bb4845 (patch)
tree8a9587a53f0161fe95141d982ff4cea40075372b /Dockerfile
parente36479d9ffd71b504bc99501ea1fef2579ff46b6 (diff)
parentdecae8c119e0f4750d10909abc47d8afb89af362 (diff)
downloadShaarli-5420c87e22570c8aface1dfe5fc1f54bd6bb4845.tar.gz
Shaarli-5420c87e22570c8aface1dfe5fc1f54bd6bb4845.tar.zst
Shaarli-5420c87e22570c8aface1dfe5fc1f54bd6bb4845.zip
Merge pull request #1157 from virtualtam/v0.9-dockerfile
v0.9 - Build the Docker images from the local sources
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile61
1 files changed, 61 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..93146c52
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,61 @@
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 \
8 && mkdocs build
9
10# Stage 2:
11# - Resolve PHP dependencies with Composer
12FROM composer:latest as composer
13COPY --from=docs /usr/src/app/shaarli /app/shaarli
14RUN cd shaarli \
15 && composer --prefer-dist --no-dev install
16
17# Stage 3:
18# - Shaarli image
19FROM alpine:3.6
20LABEL maintainer="Shaarli Community"
21
22RUN apk --update --no-cache add \
23 ca-certificates \
24 nginx \
25 php7 \
26 php7-ctype \
27 php7-curl \
28 php7-fpm \
29 php7-gd \
30 php7-iconv \
31 php7-intl \
32 php7-json \
33 php7-mbstring \
34 php7-openssl \
35 php7-session \
36 php7-xml \
37 php7-zlib \
38 s6
39
40COPY .docker/nginx.conf /etc/nginx/nginx.conf
41COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
42COPY .docker/services.d /etc/services.d
43
44RUN rm -rf /etc/php7/php-fpm.d/www.conf \
45 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
46 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
47
48
49WORKDIR /var/www
50COPY --from=composer /app/shaarli shaarli
51
52RUN chown -R nginx:nginx . \
53 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
54 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
55
56VOLUME /var/www/shaarli/data
57
58EXPOSE 80
59
60ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
61CMD []