From 3059ab52975b15fff1c4c220ae620a9796ded2e7 Mon Sep 17 00:00:00 2001 From: Jon Ervine Date: Fri, 19 Feb 2021 12:03:40 +0800 Subject: [PATCH] Bumped build --- Dockerfile | 40 ++++++++++++++++++++-------------------- Jenkinsfile | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66a12e9..2de0884 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ # Base on latest (edge) alpine image -FROM node:15-alpine3.13 -MAINTAINER Sven Fischer - -WORKDIR /src - -RUN apk add --no-cache --virtual .build-deps \ - git python3 make g++ \ - && apk add --no-cache openssh-client \ - && git clone https://github.com/krishnasrinivas/wetty --branch main /src \ - && npm install \ - && apk del .build-deps \ - && adduser -h /src -D term \ - && npm run-script build - -ADD run.sh /src - -# Default ENV params used by wetty -ENV REMOTE_SSH_SERVER=127.0.0.1 \ - REMOTE_SSH_PORT=22 +FROM node:current-alpine as builder +RUN apk add -U build-base python3 \ + && git clone https://github.com/butlerx/wetty --branch main /usr/src/app +WORKDIR /usr/src/app +COPY . /usr/src/app +RUN yarn && \ + yarn build && \ + yarn install --production --ignore-scripts --prefer-offline +FROM node:current-alpine +LABEL maintainer="butlerx@notthe.cloud" +WORKDIR /usr/src/app +ENV NODE_ENV=production +EXPOSE 3000 +COPY --from=builder /usr/src/app/build /usr/src/app/build +COPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules +COPY package.json /usr/src/app +RUN apk add -U openssh-client sshpass && \ + mkdir ~/.ssh EXPOSE 3000 -CMD [ "/bin/sh", "-c", "/src/run.sh" ] +ENTRYPOINT [ "yarn" , "docker-entrypoint"] + diff --git a/Jenkinsfile b/Jenkinsfile index 238d622..bff4b51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ spec: stage('Build with Kaniko') { git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-wetty.git', credentialsId: 'jenkins-to-git' container('kaniko') { - sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/public/x86_64/alpine/wetty:1.3.1' + sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/public/x86_64/alpine/wetty:1.3.2' } } stage('Notify gchat') {