Improved deploy speed

This commit is contained in:
Juan 2018-06-11 12:31:11 +02:00
parent 9004173f15
commit 281f539aea
17 changed files with 22 additions and 114 deletions

View File

@ -1,13 +1,5 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY . /app
COPY ../loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3000

2
Jenkinsfile vendored
View File

@ -29,6 +29,7 @@ node {
}
stage ('Install client Node dependencies') {
sh "npm install"
sh "gulp install"
}
stage ('Build project') {
sh "gulp build"
@ -40,6 +41,7 @@ node {
sh "docker-compose down --rmi 'all'"
}
stage ('Generating new dockers') {
sh "doker build -t vn-loopback:latest ./services/loopback/"
sh "docker-compose up -d --build"
}
}

View File

@ -155,10 +155,12 @@ gulp.task('docker-compose', async () => {
let services = await getServices();
for (let service of services) {
let dockerFile = `${__dirname}/services/${service.name}/Dockerfile`;
let dockerFile = `Dockerfile`;
// if (await fs.exists(`./services/${service.name}/Dockerfile`))
// dockerFile = 'Dockerfile';
let localDockerFile = `${__dirname}/services/${service.name}/Dockerfile`;
if (await fs.exists(localDockerFile))
dockerFile = localDockerFile;
composeYml.services[service.name] = {
environment: [

View File

@ -1,12 +1,7 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY auth /app
COPY loopback /loopback
COPY nginx/static/webpack-assets.json /loopback/client/
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,12 +1,6 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY client /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,12 +1,6 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY item /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -0,0 +1,4 @@
FROM node:8.9.4
COPY . /loopback
RUN npm -g install pm2

View File

@ -1,11 +1,6 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY mailer /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,12 +0,0 @@
FROM node:8.9.4
COPY order /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,16 +0,0 @@
{
"name": "vn-order",
"version": "1.0.0",
"main": "server/server.js",
"scripts": {
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint && nsp check"
},
"repository": {
"type": "git",
"url": "https://git.verdnatura.es/salix"
},
"license": "GPL-3.0",
"description": "vn-order"
}

View File

@ -1,6 +0,0 @@
{
}

View File

@ -1,5 +0,0 @@
var vnLoopback = require('../../loopback/server/server.js');
var app = module.exports = vnLoopback.loopback();
vnLoopback.boot(app, __dirname, module);

View File

@ -1,11 +1,5 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY print /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,11 +1,5 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY production /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,11 +1,5 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY route /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,12 +1,6 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY salix /app
COPY loopback /loopback
COPY nginx/static/webpack-assets.json /loopback/client/
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]

View File

@ -1,12 +1,5 @@
FROM node:8.9.4
FROM vn-loopback:latest
COPY ticket /app
COPY loopback /loopback
WORKDIR /app
RUN npm install
RUN npm -g install pm2
CMD ["pm2-docker", "./server/server.js"]