]> git.nbdom.net Git - nb.git/commitdiff
Bed
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 12 Dec 2016 01:18:45 +0000 (01:18 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 12 Dec 2016 01:18:45 +0000 (01:18 +0000)
src/Docker/nginx/Dockerfile
www/dbq/docker-compose.yaml
www/dbq/etc/nginx/default.conf

index 659dd51cbfa11a7709c159ceb5b75101771de864..f584fe9299cc672e4f91bfe9670f6eeda20a04a4 100644 (file)
@@ -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 '<html><head><title>Welcom to Nginx Php Fpm</title></head><body><h1>Welcom to Nginx Php Fpm</h1></body></html>' > $WWW_ROOT/index.html
index fcc24a72e3ef9a2d8dcd48fd7c2a702be4e53917..c91bf1fbee434ad8373a321b963a02e229e015e0 100644 (file)
@@ -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
index 9f614b03b3efa9604b79ccbf1e008c610b791b37..6c904a314f89fe2ecafea863f660da9371e6fad5 100644 (file)
@@ -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;