aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.dockerignore4
-rw-r--r--Dockerfile12
-rw-r--r--Makefile11
3 files changed, 22 insertions, 5 deletions
diff --git a/.dockerignore b/.dockerignore
index c92a2a14..9a18e085 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,3 +1,7 @@
1# Docker-ignore
2# Note: .git/ is kept for HTML documentation generation
3tests
4
1# Shaarli runtime resources 5# Shaarli runtime resources
2cache/* 6cache/*
3data/* 7data/*
diff --git a/Dockerfile b/Dockerfile
index 5e03814c..e8067031 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,20 @@
1# Stage 1: 1# Stage 1:
2# - Get Shaarli sources 2# - Get Shaarli sources
3# - Build documentation
4FROM dalibo/pandocker:stable as docs
5ADD . /pandoc/shaarli
6RUN cd /pandoc/shaarli \
7 && make htmldoc \
8 && rm -rf .git
9
10# Stage 2:
3# - Resolve PHP dependencies with Composer 11# - Resolve PHP dependencies with Composer
4FROM composer:latest as composer 12FROM composer:latest as composer
5ADD . /app/shaarli 13COPY --from=docs /pandoc/shaarli /app/shaarli
6RUN cd shaarli \ 14RUN cd shaarli \
7 && composer --prefer-dist --no-dev install 15 && composer --prefer-dist --no-dev install
8 16
9# Stage 2: 17# Stage 3:
10# - Shaarli image 18# - Shaarli image
11FROM debian:jessie 19FROM debian:jessie
12LABEL maintainer="Shaarli Community" 20LABEL maintainer="Shaarli Community"
diff --git a/Makefile b/Makefile
index 60aec9a0..47f3530f 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
11# - install Xdebug for PHPUnit code coverage reports: 11# - install Xdebug for PHPUnit code coverage reports:
12# - see http://xdebug.org/docs/install 12# - see http://xdebug.org/docs/install
13# - enable in php.ini 13# - enable in php.ini
14SHELL := /bin/bash
14 15
15BIN = vendor/bin 16BIN = vendor/bin
16PHP_SOURCE = index.php application tests plugins 17PHP_SOURCE = index.php application tests plugins
@@ -203,14 +204,18 @@ htmlsidebar:
203htmlpages: 204htmlpages:
204 @for file in `find doc/ -maxdepth 1 -name "*.md"`; do \ 205 @for file in `find doc/ -maxdepth 1 -name "*.md"`; do \
205 base=`basename $$file .md`; \ 206 base=`basename $$file .md`; \
206 sed -i "1i #$${base//-/ }" $$file; \ 207 sed -i "1i # $${base//-/ }" $$file; \
207 awk 'BEGIN { FS = "[\\[\\]]{2}" }'\ 208 awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
208 'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\ 209 'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
209 '!m { print $$0 }' $$file > doc/tmp.md; \ 210 '!m { print $$0 }' $$file > doc/tmp.md; \
210 mv doc/tmp.md $$file; \ 211 mv doc/tmp.md $$file; \
211 pandoc -f markdown_github -t html5 -s \ 212 pandoc -f gfm \
213 -t html5 \
214 -s \
212 -c "github-markdown.css" \ 215 -c "github-markdown.css" \
213 -T Shaarli -M pagetitle:"$${base//-/ }" -B doc/sidebar.html \ 216 -T Shaarli \
217 -M pagetitle:"$${base//-/ }" \
218 -B doc/sidebar.html \
214 -o doc/$$base.html $$file; \ 219 -o doc/$$base.html $$file; \
215 done; 220 done;
216 221