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',