aboutsummaryrefslogtreecommitdiffhomepage
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
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
-rw-r--r--.docker/.htaccess (renamed from docker/.htaccess)0
-rw-r--r--.docker/nginx.conf (renamed from docker/alpine/nginx.conf)0
-rw-r--r--.docker/php-fpm.conf (renamed from docker/alpine/php-fpm.conf)0
-rwxr-xr-x.docker/services.d/.s6-svscan/finish (renamed from docker/alpine/services.d/.s6-svscan/finish)0
-rwxr-xr-x.docker/services.d/nginx/run (renamed from docker/alpine/services.d/nginx/run)0
-rwxr-xr-x.docker/services.d/php-fpm/run (renamed from docker/alpine/services.d/php-fpm/run)0
-rw-r--r--.dockerignore44
-rw-r--r--.gitattributes4
-rw-r--r--CHANGELOG.md7
-rw-r--r--Dockerfile61
-rw-r--r--Dockerfile.armhf (renamed from docker/alpine/Dockerfile.armhf.latest)11
-rw-r--r--docker/alpine/Dockerfile.armhf.master47
-rw-r--r--docker/alpine/Dockerfile.latest47
-rw-r--r--docker/alpine/Dockerfile.master47
-rw-r--r--docker/alpine/IMAGE.md10
-rw-r--r--docker/debian/Dockerfile.stable37
-rw-r--r--docker/debian/IMAGE.md5
-rw-r--r--docker/debian/nginx.conf72
-rw-r--r--docker/debian/supervised.conf13
-rw-r--r--tests/docker/alpine36/Dockerfile (renamed from docker/test/alpine36/Dockerfile)0
-rw-r--r--tests/docker/debian8/Dockerfile (renamed from docker/test/debian8/Dockerfile)0
-rw-r--r--tests/docker/debian9/Dockerfile (renamed from docker/test/debian9/Dockerfile)0
-rw-r--r--tests/docker/ubuntu16/Dockerfile (renamed from docker/test/ubuntu16/Dockerfile)0
23 files changed, 121 insertions, 284 deletions
diff --git a/docker/.htaccess b/.docker/.htaccess
index f601c1ee..f601c1ee 100644
--- a/docker/.htaccess
+++ b/.docker/.htaccess
diff --git a/docker/alpine/nginx.conf b/.docker/nginx.conf
index 07fba33f..07fba33f 100644
--- a/docker/alpine/nginx.conf
+++ b/.docker/nginx.conf
diff --git a/docker/alpine/php-fpm.conf b/.docker/php-fpm.conf
index 0843c164..0843c164 100644
--- a/docker/alpine/php-fpm.conf
+++ b/.docker/php-fpm.conf
diff --git a/docker/alpine/services.d/.s6-svscan/finish b/.docker/services.d/.s6-svscan/finish
index 1dadeeaf..1dadeeaf 100755
--- a/docker/alpine/services.d/.s6-svscan/finish
+++ b/.docker/services.d/.s6-svscan/finish
diff --git a/docker/alpine/services.d/nginx/run b/.docker/services.d/nginx/run
index 21e7b0d6..21e7b0d6 100755
--- a/docker/alpine/services.d/nginx/run
+++ b/.docker/services.d/nginx/run
diff --git a/docker/alpine/services.d/php-fpm/run b/.docker/services.d/php-fpm/run
index 21dd0107..21dd0107 100755
--- a/docker/alpine/services.d/php-fpm/run
+++ b/.docker/services.d/php-fpm/run
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..cdd0a894
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,44 @@
1# Docker-ignore
2.dev
3.git
4.github
5tests
6
7# Shaarli runtime resources
8cache/*
9data/*
10pagecache/*
11tmp/*
12
13# Eclipse project files
14.settings
15.buildpath
16.project
17
18# Raintpl generated pages
19*.rtpl.php
20
21# 3rd-party dependencies
22vendor/
23
24# Release archives
25*.tar.gz
26*.zip
27inc/languages/*/LC_MESSAGES/shaarli.mo
28
29# Development and test resources
30coverage
31doxygen
32sandbox
33phpmd.html
34
35# User plugin configuration
36plugins/*/config.php
37
38# HTML documentation
39doc/html/
40
41# 3rd party themes
42tpl/*
43!tpl/default
44!tpl/vintage
diff --git a/.gitattributes b/.gitattributes
index b191e227..00070561 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -32,7 +32,9 @@ Dockerfile text
32.travis.yml export-ignore 32.travis.yml export-ignore
33doc/**/*.json export-ignore 33doc/**/*.json export-ignore
34doc/**/*.md export-ignore 34doc/**/*.md export-ignore
35docker/ export-ignore 35.docker/ export-ignore
36.dockerignore export-ignore
37Dockerfile* export-ignore
36Doxyfile export-ignore 38Doxyfile export-ignore
37Makefile export-ignore 39Makefile export-ignore
38mkdocs.yml export-ignore 40mkdocs.yml export-ignore
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14a4f143..4f72436b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,8 +4,13 @@ All notable changes to this project will be documented in this file.
4The format is based on [Keep a Changelog](http://keepachangelog.com/) 4The format is based on [Keep a Changelog](http://keepachangelog.com/)
5and this project adheres to [Semantic Versioning](http://semver.org/). 5and this project adheres to [Semantic Versioning](http://semver.org/).
6 6
7## [v0.9.7](https://github.com/shaarli/Shaarli/releases/tag/v0.9.7) - UNPUBLISHED
8### Changed
9- Build the Docker images from the local Git sources
10
11
7## [v0.9.6](https://github.com/shaarli/Shaarli/releases/tag/v0.9.6) - 2018-03-25 12## [v0.9.6](https://github.com/shaarli/Shaarli/releases/tag/v0.9.6) - 2018-03-25
8## Changed 13### Changed
9- htaccess: prevent accessing resources not managed by SCM 14- htaccess: prevent accessing resources not managed by SCM
10- htaccess: always forward the 'Authorization' HTTP header 15- htaccess: always forward the 'Authorization' HTTP header
11 16
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 []
diff --git a/docker/alpine/Dockerfile.armhf.latest b/Dockerfile.armhf
index c923834a..24695633 100644
--- a/docker/alpine/Dockerfile.armhf.latest
+++ b/Dockerfile.armhf
@@ -1,4 +1,5 @@
1FROM lsiobase/alpine.armhf:3.6 1FROM lsiobase/alpine.armhf:3.6
2LABEL maintainer="Shaarli Community"
2MAINTAINER Shaarli Community 3MAINTAINER Shaarli Community
3 4
4RUN apk --update --no-cache add \ 5RUN apk --update --no-cache add \
@@ -21,9 +22,9 @@ RUN apk --update --no-cache add \
21 php7-zlib \ 22 php7-zlib \
22 s6 23 s6
23 24
24COPY nginx.conf /etc/nginx/nginx.conf 25COPY .docker/nginx.conf /etc/nginx/nginx.conf
25COPY php-fpm.conf /etc/php7/php-fpm.conf 26COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
26COPY services.d /etc/services.d 27COPY .docker/services.d /etc/services.d
27 28
28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \ 29RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
29 && rm -rf /etc/php7/php-fpm.d/www.conf \ 30 && rm -rf /etc/php7/php-fpm.d/www.conf \
@@ -37,7 +38,9 @@ RUN curl -L https://github.com/shaarli/Shaarli/archive/latest.tar.gz | tar xzf -
37 && cd shaarli \ 38 && cd shaarli \
38 && composer --prefer-dist --no-dev install \ 39 && composer --prefer-dist --no-dev install \
39 && rm -rf ~/.composer \ 40 && rm -rf ~/.composer \
40 && chown -R nginx:nginx . 41 && chown -R nginx:nginx . \
42 && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
43 && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
41 44
42VOLUME /var/www/shaarli/data 45VOLUME /var/www/shaarli/data
43 46
diff --git a/docker/alpine/Dockerfile.armhf.master b/docker/alpine/Dockerfile.armhf.master
deleted file mode 100644
index 7f1bdf85..00000000
--- a/docker/alpine/Dockerfile.armhf.master
+++ /dev/null
@@ -1,47 +0,0 @@
1FROM lsiobase/alpine.armhf:3.6
2MAINTAINER Shaarli Community
3
4RUN apk --update --no-cache add \
5 ca-certificates \
6 curl \
7 nginx \
8 php7 \
9 php7-ctype \
10 php7-curl \
11 php7-fpm \
12 php7-gd \
13 php7-iconv \
14 php7-intl \
15 php7-json \
16 php7-mbstring \
17 php7-openssl \
18 php7-phar \
19 php7-session \
20 php7-xml \
21 php7-zlib \
22 s6
23
24COPY nginx.conf /etc/nginx/nginx.conf
25COPY php-fpm.conf /etc/php7/php-fpm.conf
26COPY services.d /etc/services.d
27
28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
29 && rm -rf /etc/php7/php-fpm.d/www.conf \
30 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
31 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
32
33
34WORKDIR /var/www
35RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \
36 && mv Shaarli-master shaarli \
37 && cd shaarli \
38 && composer --prefer-dist --no-dev install \
39 && rm -rf ~/.composer \
40 && chown -R nginx:nginx .
41
42VOLUME /var/www/shaarli/data
43
44EXPOSE 80
45
46ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
47CMD []
diff --git a/docker/alpine/Dockerfile.latest b/docker/alpine/Dockerfile.latest
deleted file mode 100644
index dd4a173c..00000000
--- a/docker/alpine/Dockerfile.latest
+++ /dev/null
@@ -1,47 +0,0 @@
1FROM alpine:3.6
2MAINTAINER Shaarli Community
3
4RUN apk --update --no-cache add \
5 ca-certificates \
6 curl \
7 nginx \
8 php7 \
9 php7-ctype \
10 php7-curl \
11 php7-fpm \
12 php7-gd \
13 php7-iconv \
14 php7-intl \
15 php7-json \
16 php7-mbstring \
17 php7-openssl \
18 php7-phar \
19 php7-session \
20 php7-xml \
21 php7-zlib \
22 s6
23
24COPY nginx.conf /etc/nginx/nginx.conf
25COPY php-fpm.conf /etc/php7/php-fpm.conf
26COPY services.d /etc/services.d
27
28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
29 && rm -rf /etc/php7/php-fpm.d/www.conf \
30 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
31 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
32
33
34WORKDIR /var/www
35RUN curl -L https://github.com/shaarli/Shaarli/archive/latest.tar.gz | tar xzf - \
36 && mv Shaarli-latest shaarli \
37 && cd shaarli \
38 && composer --prefer-dist --no-dev install \
39 && rm -rf ~/.composer \
40 && chown -R nginx:nginx .
41
42VOLUME /var/www/shaarli/data
43
44EXPOSE 80
45
46ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
47CMD []
diff --git a/docker/alpine/Dockerfile.master b/docker/alpine/Dockerfile.master
deleted file mode 100644
index 58f7c6e7..00000000
--- a/docker/alpine/Dockerfile.master
+++ /dev/null
@@ -1,47 +0,0 @@
1FROM alpine:3.6
2MAINTAINER Shaarli Community
3
4RUN apk --update --no-cache add \
5 ca-certificates \
6 curl \
7 nginx \
8 php7 \
9 php7-ctype \
10 php7-curl \
11 php7-fpm \
12 php7-gd \
13 php7-iconv \
14 php7-intl \
15 php7-json \
16 php7-mbstring \
17 php7-openssl \
18 php7-phar \
19 php7-session \
20 php7-xml \
21 php7-zlib \
22 s6
23
24COPY nginx.conf /etc/nginx/nginx.conf
25COPY php-fpm.conf /etc/php7/php-fpm.conf
26COPY services.d /etc/services.d
27
28RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
29 && rm -rf /etc/php7/php-fpm.d/www.conf \
30 && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
31 && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
32
33
34WORKDIR /var/www
35RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \
36 && mv Shaarli-master shaarli \
37 && cd shaarli \
38 && composer --prefer-dist --no-dev install \
39 && rm -rf ~/.composer \
40 && chown -R nginx:nginx .
41
42VOLUME /var/www/shaarli/data
43
44EXPOSE 80
45
46ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
47CMD []
diff --git a/docker/alpine/IMAGE.md b/docker/alpine/IMAGE.md
deleted file mode 100644
index a8952257..00000000
--- a/docker/alpine/IMAGE.md
+++ /dev/null
@@ -1,10 +0,0 @@
1## Alpine images
2- [Alpine Linux](https://www.alpinelinux.org/)
3- [PHP-FPM](http://php-fpm.org/)
4- [Nginx](http://nginx.org/)
5
6### `shaarli/shaarli:latest`
7- [Shaarli](https://github.com/shaarli/Shaarli), `latest` branch
8
9### `shaarli/shaarli:master`
10- [Shaarli](https://github.com/shaarli/Shaarli), `master` branch
diff --git a/docker/debian/Dockerfile.stable b/docker/debian/Dockerfile.stable
deleted file mode 100644
index fc9588b0..00000000
--- a/docker/debian/Dockerfile.stable
+++ /dev/null
@@ -1,37 +0,0 @@
1FROM debian:jessie
2MAINTAINER Shaarli Community
3
4ENV TERM dumb
5RUN apt-get update \
6 && apt-get install --no-install-recommends -y \
7 ca-certificates \
8 curl \
9 nginx-light \
10 php5-curl \
11 php5-fpm \
12 php5-gd \
13 php5-intl \
14 supervisor \
15 && apt-get clean
16
17RUN sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php5/fpm/php.ini
18RUN sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php5/fpm/php.ini
19COPY nginx.conf /etc/nginx/nginx.conf
20COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
21
22ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
23RUN chmod 755 /usr/local/bin/composer
24
25WORKDIR /var/www
26RUN curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xzf - \
27 && mv Shaarli-stable shaarli \
28 && cd shaarli \
29 && composer --prefer-dist --no-dev install
30RUN rm -rf html \
31 && chown -R www-data:www-data .
32
33VOLUME /var/www/shaarli/data
34
35EXPOSE 80
36
37CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
diff --git a/docker/debian/IMAGE.md b/docker/debian/IMAGE.md
deleted file mode 100644
index d85b1d7a..00000000
--- a/docker/debian/IMAGE.md
+++ /dev/null
@@ -1,5 +0,0 @@
1## shaarli:stable
2- [Debian 8 Jessie](https://hub.docker.com/_/debian/)
3- [PHP5-FPM](http://php-fpm.org/)
4- [Nginx](http://nginx.org/)
5- [Shaarli (stable)](https://github.com/shaarli/Shaarli/tree/stable)
diff --git a/docker/debian/nginx.conf b/docker/debian/nginx.conf
deleted file mode 100644
index e8754d9b..00000000
--- a/docker/debian/nginx.conf
+++ /dev/null
@@ -1,72 +0,0 @@
1user www-data www-data;
2daemon off;
3worker_processes 4;
4
5events {
6 worker_connections 768;
7}
8
9http {
10 include mime.types;
11 default_type application/octet-stream;
12 keepalive_timeout 20;
13
14 client_max_body_size 10m;
15
16 index index.html index.php;
17
18 server {
19 listen 80;
20 root /var/www/shaarli;
21
22 access_log /var/log/nginx/shaarli.access.log;
23 error_log /var/log/nginx/shaarli.error.log;
24
25 location ~ /\. {
26 # deny access to dotfiles
27 access_log off;
28 log_not_found off;
29 deny all;
30 }
31
32 location ~ ~$ {
33 # deny access to temp editor files, e.g. "script.php~"
34 access_log off;
35 log_not_found off;
36 deny all;
37 }
38
39 location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
40 # cache static assets
41 expires max;
42 add_header Pragma public;
43 add_header Cache-Control "public, must-revalidate, proxy-revalidate";
44 }
45
46 location = /favicon.ico {
47 # serve the Shaarli favicon from its custom location
48 alias /var/www/shaarli/images/favicon.ico;
49 }
50
51 location / {
52 # Slim - rewrite URLs
53 try_files $uri /index.php$is_args$args;
54 }
55
56 location ~ (index)\.php$ {
57 # Slim - split URL path into (script_filename, path_info)
58 try_files $uri =404;
59 fastcgi_split_path_info ^(.+\.php)(/.+)$;
60
61 # filter and proxy PHP requests to PHP-FPM
62 fastcgi_pass unix:/var/run/php5-fpm.sock;
63 fastcgi_index index.php;
64 include fastcgi.conf;
65 }
66
67 location ~ \.php$ {
68 # deny access to all other PHP scripts
69 deny all;
70 }
71 }
72}
diff --git a/docker/debian/supervised.conf b/docker/debian/supervised.conf
deleted file mode 100644
index 5acd9795..00000000
--- a/docker/debian/supervised.conf
+++ /dev/null
@@ -1,13 +0,0 @@
1[program:php5-fpm]
2command=/usr/sbin/php5-fpm -F
3priority=5
4autostart=true
5autorestart=true
6
7[program:nginx]
8command=/usr/sbin/nginx
9priority=10
10autostart=true
11autorestart=true
12stdout_events_enabled=true
13stderr_events_enabled=true
diff --git a/docker/test/alpine36/Dockerfile b/tests/docker/alpine36/Dockerfile
index fa84f6e2..fa84f6e2 100644
--- a/docker/test/alpine36/Dockerfile
+++ b/tests/docker/alpine36/Dockerfile
diff --git a/docker/test/debian8/Dockerfile b/tests/docker/debian8/Dockerfile
index eaa34e9b..eaa34e9b 100644
--- a/docker/test/debian8/Dockerfile
+++ b/tests/docker/debian8/Dockerfile
diff --git a/docker/test/debian9/Dockerfile b/tests/docker/debian9/Dockerfile
index 3ab4b93d..3ab4b93d 100644
--- a/docker/test/debian9/Dockerfile
+++ b/tests/docker/debian9/Dockerfile
diff --git a/docker/test/ubuntu16/Dockerfile b/tests/docker/ubuntu16/Dockerfile
index e53ed9e3..e53ed9e3 100644
--- a/docker/test/ubuntu16/Dockerfile
+++ b/tests/docker/ubuntu16/Dockerfile