From c91871e17f55660e1a0bc1e5193c2990a2b49ca9 Mon Sep 17 00:00:00 2001 From: Joan Date: Tue, 15 Jan 2019 08:12:37 +0100 Subject: [PATCH] mailer service --- docker-compose.yml | 10 ++++++++++ services/mailer/Dockerfile | 5 +++-- services/nginx/nginx.development.mst | 3 +++ services/nginx/nginx.mst | 4 ++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 382ca620c..1f4a3ee29 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - ${PORT}:80 links: - api + - mailer api: image: registry.verdnatura.es/salix-api:${TAG} restart: unless-stopped @@ -19,3 +20,12 @@ services: volumes: - /containers/salix:/etc/salix - /mnt/storage/pdfs:/var/lib/salix/pdfs + mailer: + image: registry.verdnatura.es/salix-mailer:${TAG} + restart: unless-stopped + build: + dockerfile: services/mailer/Dockerfile + environment: + - NODE_ENV + volumes: + - /config/vn-mailer \ No newline at end of file diff --git a/services/mailer/Dockerfile b/services/mailer/Dockerfile index bd8cc10e5..29e87585e 100644 --- a/services/mailer/Dockerfile +++ b/services/mailer/Dockerfile @@ -1,5 +1,6 @@ -FROM vn-loopback:latest +FROM node:lts-slim -COPY mailer /app +RUN npm -g install pm2 +COPY . /app WORKDIR /app CMD ["pm2-docker", "./server/server.js"] diff --git a/services/nginx/nginx.development.mst b/services/nginx/nginx.development.mst index 0fc3dbd1c..55adc8645 100644 --- a/services/nginx/nginx.development.mst +++ b/services/nginx/nginx.development.mst @@ -31,6 +31,9 @@ http { } {{/services}} + location ~ ^/mailer(?:/(.*)?)$ { + proxy_pass http://127.0.0.1:{{defaultPort}}/$1$is_args$args; + } location ~ ^/static(?:/(.*)?)$ { proxy_pass http://127.0.0.1:{{devServerPort}}/$1$is_args$args; } diff --git a/services/nginx/nginx.mst b/services/nginx/nginx.mst index 39d72115d..ef57f0afc 100644 --- a/services/nginx/nginx.mst +++ b/services/nginx/nginx.mst @@ -14,6 +14,10 @@ server { } {{/services}} + location ~ ^/mailer(?:/(.*))?$ { + resolver 127.0.0.11; + proxy_pass http://mailer:{{defaultPort}}/$1$is_args$args; + } location ~ ^/static(?:/(.*))?$ { alias /salix/dist/$1; autoindex on;