]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - Dockerfile
docker: build the images from the local sources
[github/shaarli/Shaarli.git] / Dockerfile
similarity index 75%
rename from docker/alpine/Dockerfile.master
rename to Dockerfile
index 7bbe1fb77f66e46afdc80906ba2c0f6fe9a5a08b..4cda6f31316183493b65b33bb6c6dab26f680465 100644 (file)
@@ -1,13 +1,20 @@
 # Stage 1:
-# - Get Shaarli sources
+# - Copy Shaarli sources
+# - Build documentation
+FROM python:3-alpine as docs
+ADD . /usr/src/app/shaarli
+RUN cd /usr/src/app/shaarli \
+    && pip install --no-cache-dir mkdocs \
+    && mkdocs build
+
+# Stage 2:
 # - Resolve PHP dependencies with Composer
 FROM composer:latest as composer
-RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \
-    && mv Shaarli-master shaarli \
-    && cd shaarli \
+COPY --from=docs /usr/src/app/shaarli /app/shaarli
+RUN cd shaarli \
     && composer --prefer-dist --no-dev install
 
-# Stage 2:
+# Stage 3:
 # - Frontend dependencies
 FROM node:9.9-alpine as node
 COPY --from=composer /app/shaarli shaarli
@@ -16,7 +23,7 @@ RUN cd shaarli \
     && yarn run build \
     && rm -rf node_modules
 
-# Stage 3:
+# Stage 4:
 # - Shaarli image
 FROM alpine:3.6
 LABEL maintainer="Shaarli Community"
@@ -39,9 +46,9 @@ RUN apk --update --no-cache add \
         php7-zlib \
         s6
 
-COPY nginx.conf /etc/nginx/nginx.conf
-COPY php-fpm.conf /etc/php7/php-fpm.conf
-COPY services.d /etc/services.d
+COPY .docker/nginx.conf /etc/nginx/nginx.conf
+COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
+COPY .docker/services.d /etc/services.d
 
 RUN rm -rf /etc/php7/php-fpm.d/www.conf \
     && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \