From 8236926a6c60857173c91cbf0a49ebcf3f1b9434 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 22 Nov 2021 10:46:19 +0100 Subject: [PATCH] feat(docker-compose): added docker-compose file --- dockerFile => Dockerfile | 5 ++--- docker-compose.yml | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) rename dockerFile => Dockerfile (75%) create mode 100644 docker-compose.yml diff --git a/dockerFile b/Dockerfile similarity index 75% rename from dockerFile rename to Dockerfile index dbd793d..b17714b 100644 --- a/dockerFile +++ b/Dockerfile @@ -1,10 +1,9 @@ FROM node WORKDIR /app +COPY package.json ./ +RUN npm install COPY db db COPY methods methods COPY utilities utilities -COPY package.json ./ COPY server.js ./ -COPY config.js ./ -RUN npm install CMD ["node", "server.js"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..cdce5b7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.7' +services: + main: + image: registry.verdnatura.es/smart-tag:${BRANCH_NAME:?} + build: + context: . + dockerfile: Dockerfile + ports: + - 7777 + configs: + - source: config + target: /app/config.js + deploy: + replicas: 1 + placement: + constraints: + - node.role == worker +configs: + config: + external: true + name: smart-tag_config \ No newline at end of file