From ec840d68f772e6bff8b37b41b7676a9c99ab7a17 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sat, 18 Jan 2020 11:56:56 +0100 Subject: [PATCH] deployment --- .drone.yml | 30 ++++++++++++++++++++++++++++++ docker-compose.prod.yml | 19 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .drone.yml create mode 100644 docker-compose.prod.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..81da050 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,30 @@ +kind: pipeline +name: default + +steps: + - name: build + image: node:alpine + pull: always + commands: + - node -v + - yarn + - yarn run build + + - name: deploy + image: cupcakearmy/drone-deploy + pull: always + settings: + host: nicco.io + user: root + key: + from_secret: ssh_key + port: 1312 + target: /srv/web/mnist + sources: + - ./dist + - ./docker-compose.prod.yml + commands: + - docker-compose -f docker-compose.prod.yml up -d + when: + event: push + branch: master \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..2242ba4 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,19 @@ +version: '3.7' + +networks: + traefik: + external: yes + +services: + server: + image: cupcakearmy/static + restart: unless-stopped + volumes: + - ./dist:/srv:ro + networks: + - traefik + labels: + - traefik.enable=true + - traefik.port=80 + - traefik.backend=mnist + - traefik.frontend.rule=Host:mnist.nicco.io \ No newline at end of file