From f05c1f4cef2efdd88138bbf95ec40205781f5605 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 20 Oct 2021 15:26:27 +0200 Subject: [PATCH] Docker fixes --- Dockerfile | 5 +++++ Jenkinsfile | 2 +- README.md | 2 +- config.js | 7 +------ docker-compose.yml | 9 ++++++++- js/main.js | 1 - package-lock.json | 2 +- package.json | 12 ++++++++---- 8 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index d49ac5d..241cf9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,12 @@ COPY package.json package-lock.json ./ RUN npm install --only=prod COPY js js +COPY css css +COPY img img COPY \ LICENSE \ README.md \ + config.js \ + index.html \ + clockIn.html \ ./ diff --git a/Jenkinsfile b/Jenkinsfile index e01c82e..c9830b4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { agent any environment { - PROJECT_NAME = 'time-tracker' + PROJECT_NAME = 'worker-time-control' STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}" } stages { diff --git a/README.md b/README.md index 435afd5..5a34c8f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Time tracker +# Time control for workers Launch application in development environment. ``` diff --git a/config.js b/config.js index 7c7ab08..b3b50d2 100644 --- a/config.js +++ b/config.js @@ -4,10 +4,5 @@ var process = { }; var config = { - development: { - urlBase: 'http://localhost:8080' - }, - production: { - urlBase: '//app.verdnatura.es' - } + urlBase: 'http://localhost:8080' }; diff --git a/docker-compose.yml b/docker-compose.yml index f03a367..a9e0678 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,18 @@ version: '3.7' services: main: - image: registry.verdnatura.es/time-tracker + image: registry.verdnatura.es/worker-time-control ports: - 80 + configs: + - source: config + target: /usr/local/apache2/htdocs/config.js deploy: replicas: 1 placement: constraints: - node.role == worker +configs: + config: + external: true + name: worker-time-control_config diff --git a/js/main.js b/js/main.js index bdf2ac7..d7273da 100644 --- a/js/main.js +++ b/js/main.js @@ -1,4 +1,3 @@ -var config = config[process.env.NODE_ENV]; var urlBase = config.urlBase; function confirmReset() { diff --git a/package-lock.json b/package-lock.json index 3e2a737..6465606 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "es.verdnatura.fichador", + "name": "es.verdnatura.worker-time-control", "version": "1.0.0", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index de17fbe..c9d2ef7 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,18 @@ { "name": "es.verdnatura.worker-time-control", - "displayName": "Fichador", - "version": "1.0.0", + "version": "1.0.1", + "author": "Verdnatura Levante SL", "description": "Fichador", + "displayName": "Fichador", "main": "index.js", + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "https://gitea.verdnatura.es/verdnatura/vn-database" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "Verdnatura Levante SL", - "license": "GPL-3.0", "dependencies": { "fastclick": "^1.0.6", "jquery": "^3.6.0"