Kaynağa Gözat

feat : add CI + update Dockerfile

master
Adrien 4 yıl önce
ebeveyn
işleme
19eee69906
4 değiştirilmiş dosya ile 35 ekleme ve 3 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -1,4 +1,5 @@
FROM node:erbium
FROM node:erbium-alpine
RUN apk add python2
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn


+ 2
- 1
Dockerfile.production Dosyayı Görüntüle

@@ -1,7 +1,7 @@
FROM node:erbium-alpine as build-stage
RUN apk add python2
WORKDIR /app
COPY package.json .
COPY package.json yarn.lock ./
RUN yarn
COPY . .
RUN yarn build
@@ -9,5 +9,6 @@ RUN yarn build
FROM nginx:1.17.9-alpine as production-stage
RUN mkdir /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


+ 0
- 1
config/docker/nginx.conf Dosyayı Görüntüle

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




Yükleniyor…
İptal
Kaydet