From 594ee68ca6129a767ad16b484e4d841907d3dbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Goetz?= Date: Fri, 5 Aug 2016 23:10:23 +0200 Subject: [PATCH] Add a docker-compose configuration to try to reproduce #386 --- README.md | 11 +++++++++++ docker/docker-compose.5.yml | 18 ++++++++++++++++++ docker/docker-compose.7.yml | 18 ++++++++++++++++++ docker/nginx_default.conf | 26 ++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 docker/docker-compose.5.yml create mode 100644 docker/docker-compose.7.yml create mode 100644 docker/nginx_default.conf diff --git a/README.md b/README.md index 0646e02..760ad3c 100755 --- a/README.md +++ b/README.md @@ -368,6 +368,17 @@ The `web.config` needs an entry for `` under ``: To use clean URLs on IIS 6, you will need to use a custom URL rewrite module, such as [URL Rewriter](http://urlrewriter.net/). +## Docker + +A docker configuration is also provided to run daux within a container, you can either run daux with php5 or php7. + +``` +cd docker +docker-compose -f docker-compose.7.yml up -d +``` + +You can then point your browser to http://localhost:8086 + ## Compatibility Daux.io is compatible with PHP 5.5 and up. diff --git a/docker/docker-compose.5.yml b/docker/docker-compose.5.yml new file mode 100644 index 0000000..5b3638b --- /dev/null +++ b/docker/docker-compose.5.yml @@ -0,0 +1,18 @@ +version: '2' + +services: + nginx: + image: nginx + ports: + - 8086:80 + volumes: + - ../:/var/www:ro + - ./nginx_default.conf:/etc/nginx/conf.d/default.conf + links: + - phpserver + + phpserver: + image: php:5-fpm + working_dir: /var/www/ + volumes: + - ../:/var/www/ diff --git a/docker/docker-compose.7.yml b/docker/docker-compose.7.yml new file mode 100644 index 0000000..65d6149 --- /dev/null +++ b/docker/docker-compose.7.yml @@ -0,0 +1,18 @@ +version: '2' + +services: + nginx: + image: nginx + ports: + - 8086:80 + volumes: + - ../:/var/www:ro + - ./nginx_default.conf:/etc/nginx/conf.d/default.conf + links: + - phpserver + + phpserver: + image: php:7.0-fpm + working_dir: /var/www/ + volumes: + - ../:/var/www/ diff --git a/docker/nginx_default.conf b/docker/nginx_default.conf new file mode 100644 index 0000000..1411198 --- /dev/null +++ b/docker/nginx_default.conf @@ -0,0 +1,26 @@ +server { + listen 80; + server_name daux.io; + + index index.php; + charset utf-8; + + root /var/www; + + location / { + if (!-e $request_filename){ + rewrite ^(.*)$ /index.php$1; + } + } + + location ~ \.php { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + + fastcgi_pass phpserver:9000; + fastcgi_index index.php; + + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } +}