diff --git a/Jenkinsfile b/Jenkinsfile index 3d33de37b8..aaced7ee8e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,14 +7,15 @@ def branchName = "${env.BRANCH_NAME}"; def branchNameTest = "preprod"; def branchNameProd = "master"; def prefixDocker = "test"; -def dockerNginxName = ["nginx", "-p 80:80 --privileged --link test-auth:auth --link test-salix:salix --link test-client:client"] +def dockerNginxName = ["nginx", "-p 80:80 --privileged --link test-auth:auth --link test-salix:salix --link test-client:client --link test-mailer:mailer"] def dockerAuthName = ["auth", "-p 3000:3000"] def dockerSalixName = ["salix", "-p 3001:3001"] def dockerClientName = ["client", "-p 3002:3002"] +def dockerMailerName = ["mailer", "-p 3003:3003"] def buildNumber = "${env.BUILD_NUMBER}"; -def dockers = [dockerAuthName, dockerSalixName, dockerClientName, dockerNginxName] +def dockers = [dockerAuthName, dockerSalixName, dockerClientName, dockerMailerName, dockerNginxName] node { diff --git a/services/mailer/Dockerfile b/services/mailer/Dockerfile new file mode 100644 index 0000000000..1f9574a645 --- /dev/null +++ b/services/mailer/Dockerfile @@ -0,0 +1,11 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] + +EXPOSE 3003 diff --git a/services/nginx/conf-dev.conf b/services/nginx/conf-dev.conf index 3bec6e4639..51d72c315f 100644 --- a/services/nginx/conf-dev.conf +++ b/services/nginx/conf-dev.conf @@ -31,14 +31,17 @@ http { location ~ ^/auth(?:/(.*))?$ { proxy_pass http://127.0.0.1:3000/$1$is_args$args; } + location ~ ^(?:/(.*))?$ { + proxy_pass http://127.0.0.1:3001/$1$is_args$args; + } location ~ ^/client(?:/(.*))?$ { proxy_pass http://127.0.0.1:3002/$1$is_args$args; } location ~ ^/mailer(?:/(.*))?$ { proxy_pass http://127.0.0.1:3003/$1$is_args$args; } - location ~ ^(?:/(.*))?$ { - proxy_pass http://127.0.0.1:3001/$1$is_args$args; + location ~ ^/production(?:/(.*))?$ { + proxy_pass http://127.0.0.1:3004/$1$is_args$args; } } diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index ac814c46f3..9ba46e97ee 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -19,21 +19,24 @@ http { root /usr/share/nginx/html; - location /static { + location ~ ^/static(?:/(.*))?$ { alias /usr/share/nginx/html; autoindex on; } location ~ ^/auth(?:/(.*))?$ { proxy_pass http://auth:3000/$1$is_args$args; } + location ~ ^(?:/(.*))?$ { + proxy_pass http://salix:3001/$1$is_args$args; + } location ~ ^/client(?:/(.*))?$ { proxy_pass http://client:3002/$1$is_args$args; } location ~ ^/mailer(?:/(.*))?$ { proxy_pass http://mailer:3003/$1$is_args$args; } - location ~ ^(?:/(.*))?$ { - proxy_pass http://salix:3001/$1$is_args$args; + location ~ ^/production(?:/(.*))?$ { + proxy_pass http://production:3004/$1$is_args$args; } } } diff --git a/services/production/Dockerfile b/services/production/Dockerfile new file mode 100644 index 0000000000..7c672f9a69 --- /dev/null +++ b/services/production/Dockerfile @@ -0,0 +1,11 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] + +EXPOSE 3004