From 5d456ee817e081ec95daf5acf463359e3a710b42 Mon Sep 17 00:00:00 2001 From: Sebastian Seedorf Date: Mon, 19 Apr 2021 14:42:13 +0200 Subject: [PATCH] Added Jenkinsfile 15 --- Dockerfile | 6 +++++- Jenkinsfile | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d2bc00..d8eb0ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,15 @@ FROM node:15-alpine WORKDIR /app +ENV NODE_ENV=production COPY ./public /app/public COPY ./views /app/views -COPY ./dist /app/views +COPY ./dist /app/dist COPY ./package.json /app/package.json +COPY ./package-lock.json /app/package-lock.json + +RUN npm install ENTRYPOINT npm start EXPOSE 3000 \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index e30f91e..3c4188a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,7 +97,7 @@ node { sh 'npm prune' sh 'rm node_modules -rf' sh "docker rmi ${env.DOCKER_NAME} ${DOCKER_REGISTRY}/${env.DOCKER_NAME}" - sh 'docker image prune' + sh 'docker image prune -f' sh 'docker rmi $(docker images -a | grep "" | awk "{print \$3}") &2>/del/null || exit 0' /*mail body: 'project build successful',