aboutsummaryrefslogtreecommitdiffhomepage
path: root/docker/development
diff options
context:
space:
mode:
Diffstat (limited to 'docker/development')
-rw-r--r--docker/development/Dockerfile28
-rw-r--r--docker/development/IMAGE.md10
-rw-r--r--docker/development/nginx.conf64
-rw-r--r--docker/development/supervised.conf13
4 files changed, 115 insertions, 0 deletions
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 @@
1FROM debian:jessie
2MAINTAINER Shaarli Community
3
4RUN apt-get update \
5 && apt-get install -y \
6 nginx-light php5-fpm php5-gd supervisor \
7 git nano
8
9ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
10RUN chmod 755 /usr/local/bin/composer
11
12COPY nginx.conf /etc/nginx/nginx.conf
13COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
14RUN echo "<?php phpinfo(); ?>" > /var/www/index.php
15
16WORKDIR /var/www
17RUN rm -rf html \
18 && git clone https://github.com/shaarli/Shaarli.git shaarli \
19 && chown -R www-data:www-data .
20
21WORKDIR /var/www/shaarli
22RUN composer install
23
24VOLUME /var/www/shaarli/data
25
26EXPOSE 80
27
28CMD ["/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 @@
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 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]
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