From: Nicolas Boisselier Date: Tue, 29 Nov 2016 12:17:32 +0000 (+0000) Subject: docker.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=e5ab4adf98070856429fc8ad8d8fd36f8bae6f4c;p=nb.git docker.sh --- diff --git a/src/Docker/Compose/dbq/docker-compose.yaml b/src/Docker/Compose/dbq/docker-compose.yaml index cf4ad2f8..d5b69419 100644 --- a/src/Docker/Compose/dbq/docker-compose.yaml +++ b/src/Docker/Compose/dbq/docker-compose.yaml @@ -1,25 +1,32 @@ -app: - image: php:7.0-fpm-alpine - volumes: - #- ./../../../..:/opt/nb - - ./../../../../..:/opt - - ./../../../../www/dbq:/var/www/html - #- ./:/var/www/html - #- ./../../../../lib/php/db:/var/www/html - command: "echo . /opt/nb/etc/profile > /etc/profile.d/nb.sh" -php: - build: ../../php/ - volumes_from: - - app - expose: - - 9000 +version: '2' +services: + app: + image: php:7.0-fpm-alpine + environment: + NB_ROOT: /opt/nb + volumes: + #- ./../../../..:/opt/nb + - ./../../../../..:/opt + - ./../../../../www/dbq:/var/www/html + #- ./:/var/www/html + #- ./../../../../lib/php/db:/var/www/html + command: "echo . $NB_ROOT/etc/profile > /etc/profile.d/nb.sh" + php: + build: ../../php/ + volumes_from: + - app + expose: + - 9000 -nginx: - build: ../../nginx/ - #image: nginx:latest - volumes_from: - - php - ports: - - "8080:80" - links: - - php + nginx: + build: + context: ../../nginx/ + args: + - WWW_ROOT=$NB_ROOT/www/dbq + #image: nginx:latest + volumes_from: + - php + ports: + - "8080:80" + links: + - php diff --git a/src/Docker/nginx/Dockerfile b/src/Docker/nginx/Dockerfile index ccdd0dac..d8e3f0cd 100644 --- a/src/Docker/nginx/Dockerfile +++ b/src/Docker/nginx/Dockerfile @@ -1,4 +1,7 @@ FROM nginx:latest +ARG WWW_ROOT +ENV WWW_ROOT=${WWW_ROOT:-/var/www/html} COPY ./default.conf /etc/nginx/conf.d/default.conf -RUN mkdir -p /var/www/html && echo 'Welcom to Nginx

Welcom to Nginx

' > /var/www/html/index.html +RUN sed -ie 's,^\([\t ]*root \).*$,\1'$WWW_ROOT';,' /etc/nginx/conf.d/default.conf +RUN mkdir -p $WWW_ROOT && echo 'Welcom to Nginx

Welcom to Nginx

' > $WWW_ROOT/index.html CMD nginx -g 'daemon off;' diff --git a/www/dbq/index.php b/www/dbq/index.php index 26ee66f1..4f96b8e7 100644 --- a/www/dbq/index.php +++ b/www/dbq/index.php @@ -1,3 +1,3 @@