From 872db11076ff6a2690a802c8ceee5fc2bd41365b Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 3 Mar 2019 16:27:15 +0100 Subject: [PATCH] drone deployment --- .drone.yml | 39 +++++++++++++++++++++++++++++++++++++++ docker-compose.prod.yml | 16 ++++++++++++++++ docker-compose.yml | 10 ++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .drone.yml create mode 100644 docker-compose.prod.yml create mode 100644 docker-compose.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..471a995 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,39 @@ +pipeline: + + install: + image: node:11-alpine + commands: + - node -v + - npm -v + - npm i + + build: + image: node:11-alpine + commands: + - npm run build:prod + + copy: + image: appleboy/drone-scp + host: nicco.io + username: deploy + port: 1312 + secrets: [ ssh_key ] + target: /srv/web/home + source: + - ./public + - ./docker-compose.yml + - ./docker-compose.prod.yml + when: + event: push + branch: master + + run: + image: appleboy/drone-ssh + host: nicco.io + username: deploy + port: 1312 + secrets: [ ssh_key ] + script: + - cd /srv/web/home + - docker-compose -f docker-compose.yml -f docker-compose.prod.yml down + - docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..39365a0 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,16 @@ +version: '3' + +services: + home: + networks: + - traefik + labels: + - traefik.enable=true + - traefik.port=80 + - traefik.docker.network=traefik + - traefik.backend=home + - traefik.frontend.rule=Host:nicco.io + +networks: + traefik: + external: true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7469a30 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' + +services: + home: + image: nginx:alpine + restart: always + ports: + - 80 + volumes: + - ./public:/usr/share/nginx/html:ro \ No newline at end of file