From 5954b18cbd6dc8f5ea871e4bb537062ef9f4951d Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 12 Dec 2016 01:18:45 +0000 Subject: [PATCH] Bed --- src/Docker/nginx/Dockerfile | 6 +++--- www/dbq/docker-compose.yaml | 4 +++- www/dbq/etc/nginx/default.conf | 14 ++++++++------ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Docker/nginx/Dockerfile b/src/Docker/nginx/Dockerfile index 659dd51c..f584fe92 100644 --- a/src/Docker/nginx/Dockerfile +++ b/src/Docker/nginx/Dockerfile @@ -12,13 +12,13 @@ ENV PHP_PORT=${PHP_PORT:-9000} COPY ./default.conf /etc/nginx/conf.d/default.conf # Set DOCUMENT_ROOT -RUN test "$WWW_ROOT" && sed -ie 's,^\([\t ]*root \).*$,\1'$WWW_ROOT';,' /etc/nginx/conf.d/default.conf +RUN test "$WWW_ROOT" && sed -i -e 's,^\([\t ]*root \).*$,\1'$WWW_ROOT';,' /etc/nginx/conf.d/default.conf # Set PHP_HOST -RUN test "$PHP_HOST" && sed -ie 's,^\([\t ]*fastcgi_pass \)\([^:]\+\)\(:.*\)$,\1'$PHP_HOST'\3,' /etc/nginx/conf.d/default.conf +RUN test "$PHP_HOST" && sed -i -e 's,^\([\t ]*fastcgi_pass \)\([^:]\+\)\(:.*\)$,\1'$PHP_HOST'\3,' /etc/nginx/conf.d/default.conf # Set PHP_PORT -RUN test "$PHP_PORT" && sed -ie 's,^\([\t ]*fastcgi_pass [^:]\+:\)\([0-9]\+\),\1'$PHP_PORT',' /etc/nginx/conf.d/default.conf +RUN test "$PHP_PORT" && sed -i -e 's,^\([\t ]*fastcgi_pass [^:]\+:\)\([0-9]\+\),\1'$PHP_PORT',' /etc/nginx/conf.d/default.conf # Create default index.html RUN mkdir -p $WWW_ROOT && echo 'Welcom to Nginx Php Fpm

Welcom to Nginx Php Fpm

' > $WWW_ROOT/index.html diff --git a/www/dbq/docker-compose.yaml b/www/dbq/docker-compose.yaml index fcc24a72..c91bf1fb 100644 --- a/www/dbq/docker-compose.yaml +++ b/www/dbq/docker-compose.yaml @@ -5,8 +5,10 @@ services: build: ../Docker/php/ expose: - 9000 + ports: + - "9000:9000" environment: - NB_ROOT: /opt/nb + NB_ROOT: ${NB_ROOT} hostname: dbq volumes: - ./../..:$NB_ROOT diff --git a/www/dbq/etc/nginx/default.conf b/www/dbq/etc/nginx/default.conf index 9f614b03..6c904a31 100644 --- a/www/dbq/etc/nginx/default.conf +++ b/www/dbq/etc/nginx/default.conf @@ -1,5 +1,6 @@ server { - listen 80 default_server; + listen 1973 default_server; + server_name dbq dbq.* root /var/www/html; index index.html index.php; @@ -35,16 +36,17 @@ server { ############################################################### # serve static files directly - location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ { - access_log off; - expires 30d; - } + #location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ { + # access_log off; + # expires 30d; + #} ############################################################### # FastCGI location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass php:9000; + fastcgi_pass localhost:9000; + fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; -- 2.47.3