Browse Source

feat : add CI + update Dockerfile

master
Adrien 4 years ago
parent
commit
19eee69906
4 changed files with 35 additions and 3 deletions
  1. +31
    -0
      .drone.yml
  2. +2
    -1
      Dockerfile
  3. +2
    -1
      Dockerfile.production
  4. +0
    -1
      config/docker/nginx.conf

+ 31
- 0
.drone.yml View File

@@ -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

+ 2
- 1
Dockerfile View File

@@ -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


+ 2
- 1
Dockerfile.production View File

@@ -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



+ 0
- 1
config/docker/nginx.conf View File

@@ -1,6 +1,5 @@
server { server {
listen 80; listen 80;
server_name nexus-timers.local.tld;
root /app; root /app;






Loading…
Cancel
Save