From d5da337d52478de57105cc3cf891f6e2098453d6 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 15 May 2017 07:53:06 +0200 Subject: [PATCH 1/7] Jenkins - docker nginx --- Jenkinsfile | 2 +- services/nginx/Dockerfile | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e864b77f..15a019eb4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ def branchName = "${env.BRANCH_NAME}"; def branchNameTest = "preprod"; def branchNameProd = "master"; def prefixDocker = "test"; -def dockerNginxName = ["nginx", "-p 80:8080 --link test-auth:auth --link test-salix:salix --link test-client:client"] +def dockerNginxName = ["nginx", "-p 80:8080 --cap-add NET_ADMIN --link test-auth:auth --link test-salix:salix --link test-client:client"] def dockerAuthName = ["auth", "-p 3000:3000"] def dockerSalixName = ["salix", "-p 3001:3001"] def dockerClientName = ["client", "-p 3002:3002"] diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index 727770d37..0f88e31f2 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -8,4 +8,8 @@ COPY conf-prod.conf /etc/nginx/nginx.conf COPY static /usr/share/nginx/html +RUN apt-get update && apt-get -y install vim dnsmasq + +RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d + EXPOSE 8080 \ No newline at end of file From 8a9d8c83b64fbc3401600a99937ad7c96be2bd66 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 15 May 2017 08:07:30 +0200 Subject: [PATCH 2/7] docker --- services/nginx/Dockerfile | 2 +- services/nginx/conf-prod.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index 0f88e31f2..ad45cd083 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -10,6 +10,6 @@ COPY static /usr/share/nginx/html RUN apt-get update && apt-get -y install vim dnsmasq -RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d +RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d/dnsmasq.conf EXPOSE 8080 \ No newline at end of file diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index c2a028fa8..a06efe5c1 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -25,15 +25,15 @@ http { } location ~ ^/auth(?:/(.*))?$ { - proxy_pass http://test-auth:3000/$1$is_args$args; + proxy_pass http://auth:3000/$1$is_args$args; } location ~ ^/salix(?:/(.*))?$ { - proxy_pass http://test-salix:3001/$1$is_args$args; + proxy_pass http://salix:3001/$1$is_args$args; } location ~ ^/client(?:/(.*))?$ { - proxy_pass http://test-client:3002/$1$is_args$args; + proxy_pass http://client:3002/$1$is_args$args; } } } \ No newline at end of file From 77d8a8f0907b4587c4df1143cc10869f659245e3 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 15 May 2017 08:33:51 +0200 Subject: [PATCH 3/7] Jenkins --- Jenkinsfile | 2 +- services/nginx/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 15a019eb4..7cecefe16 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ def branchName = "${env.BRANCH_NAME}"; def branchNameTest = "preprod"; def branchNameProd = "master"; def prefixDocker = "test"; -def dockerNginxName = ["nginx", "-p 80:8080 --cap-add NET_ADMIN --link test-auth:auth --link test-salix:salix --link test-client:client"] +def dockerNginxName = ["nginx", "-p 80:8080 --privileged --link test-auth:auth --link test-salix:salix --link test-client:client"] def dockerAuthName = ["auth", "-p 3000:3000"] def dockerSalixName = ["salix", "-p 3001:3001"] def dockerClientName = ["client", "-p 3002:3002"] diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index ad45cd083..1ce39be8e 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -8,7 +8,7 @@ COPY conf-prod.conf /etc/nginx/nginx.conf COPY static /usr/share/nginx/html -RUN apt-get update && apt-get -y install vim dnsmasq +RUN apt-get update && apt-get -y install vim dnsmasq dnsutils RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d/dnsmasq.conf From 6a4235a9a23a83066acf2b63389c59de74b4ed65 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 15 May 2017 08:47:58 +0200 Subject: [PATCH 4/7] Ajustes conf --- services/nginx/Dockerfile | 2 ++ services/nginx/conf-prod.conf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index 1ce39be8e..251230964 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -12,4 +12,6 @@ RUN apt-get update && apt-get -y install vim dnsmasq dnsutils RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d/dnsmasq.conf +RUN service dnsmasq restart + EXPOSE 8080 \ No newline at end of file diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index a06efe5c1..5706e3390 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -9,7 +9,7 @@ http { sendfile on; gzip on; default_type application/octet-stream; - + resolver 127.0.0.1; include /etc/nginx/mime.types; server { From eacd133d00b5e2a54bae7e74c8b27f145d00dd2c Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 15 May 2017 09:03:05 +0200 Subject: [PATCH 5/7] Docker nginx --- services/nginx/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index 251230964..1ce39be8e 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -12,6 +12,4 @@ RUN apt-get update && apt-get -y install vim dnsmasq dnsutils RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d/dnsmasq.conf -RUN service dnsmasq restart - EXPOSE 8080 \ No newline at end of file From d8df17ad0718c8fd2047ded6a054dff1bba71e66 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 15 May 2017 10:44:19 +0200 Subject: [PATCH 6/7] salix routes static --- services/nginx/conf-prod.conf | 2 +- services/salix/client/index.ejs | 2 +- services/salix/server/boot/routes.js | 15 --------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index 5706e3390..490284cab 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -20,7 +20,7 @@ http { root /usr/share/nginx/html; location /static { - alias public; + alias /usr/share/nginx/html; autoindex on; } diff --git a/services/salix/client/index.ejs b/services/salix/client/index.ejs index 43239d5af..83060a29a 100644 --- a/services/salix/client/index.ejs +++ b/services/salix/client/index.ejs @@ -7,7 +7,7 @@