From 0fe6f1dc6c3e51de31ef3bb82baa7a6cbc6d1e4a Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Sat, 13 Jan 2018 12:22:38 +0100 Subject: [PATCH] nginx ok --- .env | 7 +++++++ README.md | 13 +++++++++++++ base_d7/index.html | 10 ++++++++++ docker-compose.yml | 17 +++++++++++++++++ nginx/Dockerfile | 3 +++ nginx/default.conf | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 .env create mode 100644 README.md create mode 100644 base_d7/index.html create mode 100644 docker-compose.yml create mode 100644 nginx/Dockerfile create mode 100644 nginx/default.conf diff --git a/.env b/.env new file mode 100644 index 0000000..9666853 --- /dev/null +++ b/.env @@ -0,0 +1,7 @@ +PROJECT_ROOT=./base_d7 +LOG_ROOT=./log + +DB_ROOT_PASSWORD=project +DB_NAME=project +DB_USERNAME=project +DB_PASSWORD=project diff --git a/README.md b/README.md new file mode 100644 index 0000000..d998345 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ + +# MateriO 7.x +MateriO Base powered by druapl 7 docker environement + +# steps + + +# sources +https://www.ostraining.com/blog/drupal/docker/ + +http://tech.osteel.me/posts/2017/01/15/how-to-use-docker-for-local-web-development-an-update.html + +https://mmenozzi.github.io/2016/01/22/php-web-development-with-docker/ diff --git a/base_d7/index.html b/base_d7/index.html new file mode 100644 index 0000000..e50405e --- /dev/null +++ b/base_d7/index.html @@ -0,0 +1,10 @@ + + + + + Test nginx docker + + +

Hello world!

+ + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..51c4251 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: "3.5" + +services: + nginx: + build: ./nginx/ + ports: + - 81:80 + volumes: + - "${PROJECT_ROOT}:/var/www/html" + - "${LOG_ROOT}:/var/log:rw" + networks: + - server + # depends_on: + # - php + +networks: + server: diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..f1acc2d --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:latest + +COPY ./default.conf /etc/nginx/conf.d/default.conf diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..6e3f20f --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,36 @@ +server { + listen 80 default_server; + root /var/www/html; + index index.html index.php; + + charset utf-8; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + + access_log on; + error_log /var/log/nginx/error.log error; + + sendfile off; + + client_max_body_size 100m; + + # location ~ \.php$ { + # fastcgi_split_path_info ^(.+\.php)(/.+)$; + # fastcgi_pass php:9000; + # fastcgi_index index.php; + # include fastcgi_params; + # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + # fastcgi_intercept_errors off; + # fastcgi_buffer_size 16k; + # fastcgi_buffers 4 16k; + # } + + location ~ /\.ht { + deny all; + } +}