diff options
author | VirtualTam <virtualtam@flibidi.net> | 2015-12-24 17:17:46 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2016-01-02 19:01:33 +0100 |
commit | 453f4653c325dc23193e16432170bf634c42e8a2 (patch) | |
tree | e74568a125834e977725fe992f458e7739d2c57a /docker | |
parent | 0baf7842fc0cf4cbd5ca2b8c5ae6dc7a59c07700 (diff) | |
download | Shaarli-453f4653c325dc23193e16432170bf634c42e8a2.tar.gz Shaarli-453f4653c325dc23193e16432170bf634c42e8a2.tar.zst Shaarli-453f4653c325dc23193e16432170bf634c42e8a2.zip |
Docker: move Dockerfiles to the main repository
Relates to #420
Fixes:
- [all] remove Nginx' 'server_name' attribute
- [dev] create the phpinfo() script from the Dockerfile
Modifications:
- [all] remove documentation/guide (to be added to the wiki)
- [all] update maintainer information
- [prod] differentiate 'master' (:latest) and 'stable' (:stable) images
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'docker')
-rw-r--r-- | docker/.htaccess | 2 | ||||
-rw-r--r-- | docker/development/Dockerfile | 28 | ||||
-rw-r--r-- | docker/development/IMAGE.md | 10 | ||||
-rw-r--r-- | docker/development/nginx.conf | 64 | ||||
-rw-r--r-- | docker/development/supervised.conf | 13 | ||||
-rw-r--r-- | docker/production/Dockerfile | 20 | ||||
-rw-r--r-- | docker/production/IMAGE.md | 5 | ||||
-rw-r--r-- | docker/production/nginx.conf | 56 | ||||
-rw-r--r-- | docker/production/stable/Dockerfile | 20 | ||||
-rw-r--r-- | docker/production/stable/IMAGE.md | 5 | ||||
-rw-r--r-- | docker/production/stable/nginx.conf | 56 | ||||
-rw-r--r-- | docker/production/stable/supervised.conf | 13 | ||||
-rw-r--r-- | docker/production/supervised.conf | 13 |
13 files changed, 305 insertions, 0 deletions
diff --git a/docker/.htaccess b/docker/.htaccess new file mode 100644 index 00000000..b584d98c --- /dev/null +++ b/docker/.htaccess | |||
@@ -0,0 +1,2 @@ | |||
1 | Allow from none | ||
2 | Deny from all | ||
diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile new file mode 100644 index 00000000..2ed59b89 --- /dev/null +++ b/docker/development/Dockerfile | |||
@@ -0,0 +1,28 @@ | |||
1 | FROM debian:jessie | ||
2 | MAINTAINER Shaarli Community | ||
3 | |||
4 | RUN apt-get update \ | ||
5 | && apt-get install -y \ | ||
6 | nginx-light php5-fpm php5-gd supervisor \ | ||
7 | git nano | ||
8 | |||
9 | ADD https://getcomposer.org/composer.phar /usr/local/bin/composer | ||
10 | RUN chmod 755 /usr/local/bin/composer | ||
11 | |||
12 | COPY nginx.conf /etc/nginx/nginx.conf | ||
13 | COPY supervised.conf /etc/supervisor/conf.d/supervised.conf | ||
14 | RUN echo "<?php phpinfo(); ?>" > /var/www/index.php | ||
15 | |||
16 | WORKDIR /var/www | ||
17 | RUN rm -rf html \ | ||
18 | && git clone https://github.com/shaarli/Shaarli.git shaarli \ | ||
19 | && chown -R www-data:www-data . | ||
20 | |||
21 | WORKDIR /var/www/shaarli | ||
22 | RUN composer install | ||
23 | |||
24 | VOLUME /var/www/shaarli/data | ||
25 | |||
26 | EXPOSE 80 | ||
27 | |||
28 | CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] | ||
diff --git a/docker/development/IMAGE.md b/docker/development/IMAGE.md new file mode 100644 index 00000000..e2ff0f0e --- /dev/null +++ b/docker/development/IMAGE.md | |||
@@ -0,0 +1,10 @@ | |||
1 | ## shaarli:dev | ||
2 | - [Debian 8 Jessie](https://hub.docker.com/_/debian/) | ||
3 | - [PHP5-FPM](http://php-fpm.org/) | ||
4 | - [Nginx](http://nginx.org/) | ||
5 | - [Shaarli](https://github.com/shaarli/Shaarli) | ||
6 | |||
7 | ### Development tools | ||
8 | - [composer](https://getcomposer.org/) | ||
9 | - [git](http://git-scm.com/) | ||
10 | - [nano](http://www.nano-editor.org/) | ||
diff --git a/docker/development/nginx.conf b/docker/development/nginx.conf new file mode 100644 index 00000000..cda09b56 --- /dev/null +++ b/docker/development/nginx.conf | |||
@@ -0,0 +1,64 @@ | |||
1 | user www-data www-data; | ||
2 | daemon off; | ||
3 | worker_processes 4; | ||
4 | |||
5 | events { | ||
6 | worker_connections 768; | ||
7 | } | ||
8 | |||
9 | http { | ||
10 | include mime.types; | ||
11 | default_type application/octet-stream; | ||
12 | keepalive_timeout 20; | ||
13 | |||
14 | index index.html index.php; | ||
15 | |||
16 | server { | ||
17 | listen 80; | ||
18 | root /var/www/shaarli; | ||
19 | |||
20 | access_log /var/log/nginx/shaarli.access.log; | ||
21 | error_log /var/log/nginx/shaarli.error.log; | ||
22 | |||
23 | location /phpinfo/ { | ||
24 | # add a PHP info page for convenience | ||
25 | fastcgi_pass unix:/var/run/php5-fpm.sock; | ||
26 | fastcgi_index index.php; | ||
27 | fastcgi_param SCRIPT_FILENAME /var/www/index.php; | ||
28 | include fastcgi_params; | ||
29 | } | ||
30 | |||
31 | location ~ /\. { | ||
32 | # deny access to dotfiles | ||
33 | access_log off; | ||
34 | log_not_found off; | ||
35 | deny all; | ||
36 | } | ||
37 | |||
38 | location ~ ~$ { | ||
39 | # deny access to temp editor files, e.g. "script.php~" | ||
40 | access_log off; | ||
41 | log_not_found off; | ||
42 | deny all; | ||
43 | } | ||
44 | |||
45 | location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | ||
46 | # cache static assets | ||
47 | expires max; | ||
48 | add_header Pragma public; | ||
49 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
50 | } | ||
51 | |||
52 | location ~ (index)\.php$ { | ||
53 | # filter and proxy PHP requests to PHP-FPM | ||
54 | fastcgi_pass unix:/var/run/php5-fpm.sock; | ||
55 | fastcgi_index index.php; | ||
56 | include fastcgi.conf; | ||
57 | } | ||
58 | |||
59 | location ~ \.php$ { | ||
60 | # deny access to all other PHP scripts | ||
61 | deny all; | ||
62 | } | ||
63 | } | ||
64 | } | ||
diff --git a/docker/development/supervised.conf b/docker/development/supervised.conf new file mode 100644 index 00000000..5acd9795 --- /dev/null +++ b/docker/development/supervised.conf | |||
@@ -0,0 +1,13 @@ | |||
1 | [program:php5-fpm] | ||
2 | command=/usr/sbin/php5-fpm -F | ||
3 | priority=5 | ||
4 | autostart=true | ||
5 | autorestart=true | ||
6 | |||
7 | [program:nginx] | ||
8 | command=/usr/sbin/nginx | ||
9 | priority=10 | ||
10 | autostart=true | ||
11 | autorestart=true | ||
12 | stdout_events_enabled=true | ||
13 | stderr_events_enabled=true | ||
diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile new file mode 100644 index 00000000..3db4eb56 --- /dev/null +++ b/docker/production/Dockerfile | |||
@@ -0,0 +1,20 @@ | |||
1 | FROM debian:jessie | ||
2 | MAINTAINER Shaarli Community | ||
3 | |||
4 | RUN apt-get update \ | ||
5 | && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor | ||
6 | |||
7 | COPY nginx.conf /etc/nginx/nginx.conf | ||
8 | COPY supervised.conf /etc/supervisor/conf.d/supervised.conf | ||
9 | |||
10 | WORKDIR /var/www | ||
11 | RUN rm -rf html \ | ||
12 | && curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xvzf - \ | ||
13 | && mv Shaarli-master shaarli \ | ||
14 | && chown -R www-data:www-data shaarli | ||
15 | |||
16 | VOLUME /var/www/shaarli/data | ||
17 | |||
18 | EXPOSE 80 | ||
19 | |||
20 | CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] | ||
diff --git a/docker/production/IMAGE.md b/docker/production/IMAGE.md new file mode 100644 index 00000000..6f827b35 --- /dev/null +++ b/docker/production/IMAGE.md | |||
@@ -0,0 +1,5 @@ | |||
1 | ## shaarli:latest | ||
2 | - [Debian 8 Jessie](https://hub.docker.com/_/debian/) | ||
3 | - [PHP5-FPM](http://php-fpm.org/) | ||
4 | - [Nginx](http://nginx.org/) | ||
5 | - [Shaarli](https://github.com/shaarli/Shaarli) | ||
diff --git a/docker/production/nginx.conf b/docker/production/nginx.conf new file mode 100644 index 00000000..e23c4587 --- /dev/null +++ b/docker/production/nginx.conf | |||
@@ -0,0 +1,56 @@ | |||
1 | user www-data www-data; | ||
2 | daemon off; | ||
3 | worker_processes 4; | ||
4 | |||
5 | events { | ||
6 | worker_connections 768; | ||
7 | } | ||
8 | |||
9 | http { | ||
10 | include mime.types; | ||
11 | default_type application/octet-stream; | ||
12 | keepalive_timeout 20; | ||
13 | |||
14 | index index.html index.php; | ||
15 | |||
16 | server { | ||
17 | listen 80; | ||
18 | root /var/www/shaarli; | ||
19 | |||
20 | access_log /var/log/nginx/shaarli.access.log; | ||
21 | error_log /var/log/nginx/shaarli.error.log; | ||
22 | |||
23 | location ~ /\. { | ||
24 | # deny access to dotfiles | ||
25 | access_log off; | ||
26 | log_not_found off; | ||
27 | deny all; | ||
28 | } | ||
29 | |||
30 | location ~ ~$ { | ||
31 | # deny access to temp editor files, e.g. "script.php~" | ||
32 | access_log off; | ||
33 | log_not_found off; | ||
34 | deny all; | ||
35 | } | ||
36 | |||
37 | location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | ||
38 | # cache static assets | ||
39 | expires max; | ||
40 | add_header Pragma public; | ||
41 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
42 | } | ||
43 | |||
44 | location ~ (index)\.php$ { | ||
45 | # filter and proxy PHP requests to PHP-FPM | ||
46 | fastcgi_pass unix:/var/run/php5-fpm.sock; | ||
47 | fastcgi_index index.php; | ||
48 | include fastcgi.conf; | ||
49 | } | ||
50 | |||
51 | location ~ \.php$ { | ||
52 | # deny access to all other PHP scripts | ||
53 | deny all; | ||
54 | } | ||
55 | } | ||
56 | } | ||
diff --git a/docker/production/stable/Dockerfile b/docker/production/stable/Dockerfile new file mode 100644 index 00000000..2bb3948c --- /dev/null +++ b/docker/production/stable/Dockerfile | |||
@@ -0,0 +1,20 @@ | |||
1 | FROM debian:jessie | ||
2 | MAINTAINER Shaarli Community | ||
3 | |||
4 | RUN apt-get update \ | ||
5 | && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor | ||
6 | |||
7 | COPY nginx.conf /etc/nginx/nginx.conf | ||
8 | COPY supervised.conf /etc/supervisor/conf.d/supervised.conf | ||
9 | |||
10 | WORKDIR /var/www | ||
11 | RUN rm -rf html \ | ||
12 | && curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xvzf - \ | ||
13 | && mv Shaarli-stable shaarli \ | ||
14 | && chown -R www-data:www-data shaarli | ||
15 | |||
16 | VOLUME /var/www/shaarli/data | ||
17 | |||
18 | EXPOSE 80 | ||
19 | |||
20 | CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] | ||
diff --git a/docker/production/stable/IMAGE.md b/docker/production/stable/IMAGE.md new file mode 100644 index 00000000..d85b1d7a --- /dev/null +++ b/docker/production/stable/IMAGE.md | |||
@@ -0,0 +1,5 @@ | |||
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/production/stable/nginx.conf b/docker/production/stable/nginx.conf new file mode 100644 index 00000000..e23c4587 --- /dev/null +++ b/docker/production/stable/nginx.conf | |||
@@ -0,0 +1,56 @@ | |||
1 | user www-data www-data; | ||
2 | daemon off; | ||
3 | worker_processes 4; | ||
4 | |||
5 | events { | ||
6 | worker_connections 768; | ||
7 | } | ||
8 | |||
9 | http { | ||
10 | include mime.types; | ||
11 | default_type application/octet-stream; | ||
12 | keepalive_timeout 20; | ||
13 | |||
14 | index index.html index.php; | ||
15 | |||
16 | server { | ||
17 | listen 80; | ||
18 | root /var/www/shaarli; | ||
19 | |||
20 | access_log /var/log/nginx/shaarli.access.log; | ||
21 | error_log /var/log/nginx/shaarli.error.log; | ||
22 | |||
23 | location ~ /\. { | ||
24 | # deny access to dotfiles | ||
25 | access_log off; | ||
26 | log_not_found off; | ||
27 | deny all; | ||
28 | } | ||
29 | |||
30 | location ~ ~$ { | ||
31 | # deny access to temp editor files, e.g. "script.php~" | ||
32 | access_log off; | ||
33 | log_not_found off; | ||
34 | deny all; | ||
35 | } | ||
36 | |||
37 | location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | ||
38 | # cache static assets | ||
39 | expires max; | ||
40 | add_header Pragma public; | ||
41 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
42 | } | ||
43 | |||
44 | location ~ (index)\.php$ { | ||
45 | # filter and proxy PHP requests to PHP-FPM | ||
46 | fastcgi_pass unix:/var/run/php5-fpm.sock; | ||
47 | fastcgi_index index.php; | ||
48 | include fastcgi.conf; | ||
49 | } | ||
50 | |||
51 | location ~ \.php$ { | ||
52 | # deny access to all other PHP scripts | ||
53 | deny all; | ||
54 | } | ||
55 | } | ||
56 | } | ||
diff --git a/docker/production/stable/supervised.conf b/docker/production/stable/supervised.conf new file mode 100644 index 00000000..5acd9795 --- /dev/null +++ b/docker/production/stable/supervised.conf | |||
@@ -0,0 +1,13 @@ | |||
1 | [program:php5-fpm] | ||
2 | command=/usr/sbin/php5-fpm -F | ||
3 | priority=5 | ||
4 | autostart=true | ||
5 | autorestart=true | ||
6 | |||
7 | [program:nginx] | ||
8 | command=/usr/sbin/nginx | ||
9 | priority=10 | ||
10 | autostart=true | ||
11 | autorestart=true | ||
12 | stdout_events_enabled=true | ||
13 | stderr_events_enabled=true | ||
diff --git a/docker/production/supervised.conf b/docker/production/supervised.conf new file mode 100644 index 00000000..5acd9795 --- /dev/null +++ b/docker/production/supervised.conf | |||
@@ -0,0 +1,13 @@ | |||
1 | [program:php5-fpm] | ||
2 | command=/usr/sbin/php5-fpm -F | ||
3 | priority=5 | ||
4 | autostart=true | ||
5 | autorestart=true | ||
6 | |||
7 | [program:nginx] | ||
8 | command=/usr/sbin/nginx | ||
9 | priority=10 | ||
10 | autostart=true | ||
11 | autorestart=true | ||
12 | stdout_events_enabled=true | ||
13 | stderr_events_enabled=true | ||