From 8b79ec5cc8a85a9493273081e6446d40809fb7d2 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Tue, 28 Nov 2017 08:12:39 +0100 Subject: [PATCH] Docker service print --- services/mailer/application/auth.js | 8 ++++---- services/print/Dockerfile | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 services/print/Dockerfile diff --git a/services/mailer/application/auth.js b/services/mailer/application/auth.js index 81f423e15..7e9457537 100644 --- a/services/mailer/application/auth.js +++ b/services/mailer/application/auth.js @@ -36,13 +36,13 @@ module.exports = { let host = this.request.headers.host.split(':')[0]; let proxy; - if (host == '127.0.0.1') + if (host == '127.0.0.1') proxy = config.proxy.localhost; - else if(process.env.NODE_ENV == 'production') + else if (process.env.NODE_ENV == 'production') proxy = config.proxy.salix; - else if(process.env.NODE_ENV == 'development') + else if (process.env.NODE_ENV == 'development') proxy = config.proxy.testSalix; - + this.request.proxyHost = `http://${proxy.host}:${proxy.port}`; this.request.user = { id: token.userId, diff --git a/services/print/Dockerfile b/services/print/Dockerfile new file mode 100644 index 000000000..2e8bdc43b --- /dev/null +++ b/services/print/Dockerfile @@ -0,0 +1,13 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +RUN npm -g install pm2 + +CMD ["pm2-docker", "./server/server.js"] + +EXPOSE 3006