From 8b68ae80c2fb665e3d92bc62f457028375f10514 Mon Sep 17 00:00:00 2001 From: "SAMBA\\vfalco" Date: Thu, 17 Nov 2016 10:18:11 +0100 Subject: [PATCH] dockerfile y docker-compose --- .../customer/.editorconfig => .editorconfig | 0 @salix-services/account/Dockerfile | 9 +++ @salix-services/customer/Dockerfile | 9 +++ @salix-services/salix/Dockerfile | 9 +++ @salix/Dockerfile | 9 +++ @salix/nginx_docker.conf | 55 +++++++++++++++++++ docker-compose.yml | 22 ++++++++ 7 files changed, 113 insertions(+) rename @salix-services/customer/.editorconfig => .editorconfig (100%) create mode 100644 @salix-services/account/Dockerfile create mode 100644 @salix-services/customer/Dockerfile create mode 100644 @salix-services/salix/Dockerfile create mode 100644 @salix/Dockerfile create mode 100644 @salix/nginx_docker.conf create mode 100644 docker-compose.yml diff --git a/@salix-services/customer/.editorconfig b/.editorconfig similarity index 100% rename from @salix-services/customer/.editorconfig rename to .editorconfig diff --git a/@salix-services/account/Dockerfile b/@salix-services/account/Dockerfile new file mode 100644 index 000000000..9c8022953 --- /dev/null +++ b/@salix-services/account/Dockerfile @@ -0,0 +1,9 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] \ No newline at end of file diff --git a/@salix-services/customer/Dockerfile b/@salix-services/customer/Dockerfile new file mode 100644 index 000000000..afb62ac9a --- /dev/null +++ b/@salix-services/customer/Dockerfile @@ -0,0 +1,9 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] \ No newline at end of file diff --git a/@salix-services/salix/Dockerfile b/@salix-services/salix/Dockerfile new file mode 100644 index 000000000..afb62ac9a --- /dev/null +++ b/@salix-services/salix/Dockerfile @@ -0,0 +1,9 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] \ No newline at end of file diff --git a/@salix/Dockerfile b/@salix/Dockerfile new file mode 100644 index 000000000..3fa0bdd34 --- /dev/null +++ b/@salix/Dockerfile @@ -0,0 +1,9 @@ +FROM nginx + +RUN rm /etc/nginx/nginx.conf + +RUN rm /etc/nginx/conf.d/default.conf + +COPY nginx_docker.conf /etc/nginx/nginx.conf + +COPY build /etc/nginx \ No newline at end of file diff --git a/@salix/nginx_docker.conf b/@salix/nginx_docker.conf new file mode 100644 index 000000000..473a4bfd8 --- /dev/null +++ b/@salix/nginx_docker.conf @@ -0,0 +1,55 @@ + +worker_processes 1; + +error_log /var/log/nginx/error.log; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + sendfile on; + gzip on; + default_type application/octet-stream; + + access_log /var/log/nginx/access.log; + + server { + listen 8080; + server_name localhost; + autoindex off; + + root /usr/share/nginx/html; + + location /static { + alias public; + autoindex on; + } + + location ~ ^/account(?:/(.*))?$ { + proxy_pass http://192.168.99.100:3000/$1$is_args$args; + } + + location ~ ^/salix(?:/(.*))?$ { + proxy_pass http://192.168.99.100:3001/$1$is_args$args; + } + + location ~ ^/customer(?:/(.*))?$ { + proxy_pass http://192.168.99.100:3002/$1$is_args$args; + } + } + + types { + text/html html; + application/json json; + application/javascript js; + text/css css scss; + text/xml xml; + image/x-icon ico; + image/png png; + image/svg+xml svg; + image/gif gif; + image/jpeg jpeg jpg; + } +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..0689d0f3a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '2' +services: + account: + build: + context: ./@salix-services/account + ports: + - "3000:3000" + customer: + build: + context: ./@salix-services/customer + ports: + - "3002:3002" + nginx: + build: + context: ./@salix + ports: + - "8080:8080" + salix: + build: + context: ./@salix-services/salix + ports: + - "3001:3001" \ No newline at end of file