| @@ -0,0 +1,31 @@ | |||||
| kind: pipeline | |||||
| type: ssh | |||||
| name: push | |||||
| server: | |||||
| host: | |||||
| from_secret: ssh_host | |||||
| user: | |||||
| from_secret: ssh_user | |||||
| ssh_key: | |||||
| from_secret: ssh_key | |||||
| steps: | |||||
| - name: Build | |||||
| commands: | |||||
| - docker build . -f Dockerfile.production --tag="nexus-timers" | |||||
| - name: Stop and destroy old container | |||||
| failure: ignore | |||||
| commands: | |||||
| - docker ps -a | grep nexus-timers | awk '{system ("docker stop " $1); system ("docker rm " $1)}' | |||||
| - name: Launch new container | |||||
| commands: | |||||
| - docker run -p 7000:80 -d nexus-timers | |||||
| trigger: | |||||
| branch: | |||||
| - master | |||||
| @@ -1,4 +1,5 @@ | |||||
| FROM node:erbium | |||||
| FROM node:erbium-alpine | |||||
| RUN apk add python2 | |||||
| WORKDIR /app | WORKDIR /app | ||||
| COPY package.json yarn.lock ./ | COPY package.json yarn.lock ./ | ||||
| RUN yarn | RUN yarn | ||||
| @@ -1,7 +1,7 @@ | |||||
| FROM node:erbium-alpine as build-stage | FROM node:erbium-alpine as build-stage | ||||
| RUN apk add python2 | RUN apk add python2 | ||||
| WORKDIR /app | WORKDIR /app | ||||
| COPY package.json . | |||||
| COPY package.json yarn.lock ./ | |||||
| RUN yarn | RUN yarn | ||||
| COPY . . | COPY . . | ||||
| RUN yarn build | RUN yarn build | ||||
| @@ -9,5 +9,6 @@ RUN yarn build | |||||
| FROM nginx:1.17.9-alpine as production-stage | FROM nginx:1.17.9-alpine as production-stage | ||||
| RUN mkdir /app | RUN mkdir /app | ||||
| COPY --from=build-stage /app/dist /app | COPY --from=build-stage /app/dist /app | ||||
| RUN rm /etc/nginx/conf.d/default.conf | |||||
| COPY config/docker/nginx.conf /etc/nginx/conf.d/nexus-timers.conf | COPY config/docker/nginx.conf /etc/nginx/conf.d/nexus-timers.conf | ||||
| @@ -1,6 +1,5 @@ | |||||
| server { | server { | ||||
| listen 80; | listen 80; | ||||
| server_name nexus-timers.local.tld; | |||||
| root /app; | root /app; | ||||