From b2db25655dcd3ca75d9264cfdfa1cee975041d8c Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 25 Jun 2020 15:38:57 +0200 Subject: [PATCH] Add swarm deploy setup --- .drone.yml | 31 ++++++++++++++++++++++++------- Dockerfile | 11 +++++++++++ README.md | 3 +++ compose.yml | 28 ++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 Dockerfile create mode 100644 compose.yml diff --git a/.drone.yml b/.drone.yml index a827552..0966553 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,14 +1,31 @@ --- kind: pipeline -name: default +name: deploy to swarm.autonomic.zone steps: - - name: Deploy wiki with Dokku - image: appleboy/drone-git-push:0.2.0-linux-amd64 + - name: bundle static + image: plugins/docker settings: - remote: ssh://dokku@dokku.autonomic.zone:222/kawaiipunk.xyz - ssh_key: - from_secret: drone_deploy_key + username: + from_secret: docker_reg_username + password: + from_secret: docker_reg_passwd + repo: decentral1se/kawaiipunk.xyz + tags: v0.1.0 + + - name: deployment + image: decentral1se/drone-stack:19.03.8 + settings: + compose: compose.yml + host: tcp://swarm.autonomic.zone:2376 + stack_name: kawaiipunk-xyz + tlsverify: true + environment: + PLUGIN_CACERT: + from_secret: docker_cacert + PLUGIN_CERT: + from_secret: docker_cert + PLUGIN_KEY: + from_secret: docker_key trigger: branch: - master - diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..79bb8ef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.8-alpine + +EXPOSE 8000 + +COPY . . + +ENTRYPOINT ["/bin/sh"] + +RUN apk add --no-cache curl + +CMD ["-c", "python -m http.server --bind 0.0.0.0 --directory . 8000"] diff --git a/README.md b/README.md index cc027ae..2837a6b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Welcome to KawaiiPunk's Walkaway Wiki + +[![Build Status](https://drone.autonomic.zone/api/badges/kawaiipunk/walkaway-wiki/status.svg)](https://drone.autonomic.zone/kawaiipunk/walkaway-wiki) + This is an experimental attempt to create a "walkaway wiki" as referenced in Cory Doctorow's book **Walkaway**. It is hosted on the Peer to Peer web and then mirrored to the old web. It's nothing fancy. I will just be using it as a blog and mind dump for my solarpunk explorations. Enjoy. You can find it on dat: diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..febc250 --- /dev/null +++ b/compose.yml @@ -0,0 +1,28 @@ +--- +version: "3.8" + +services: + mkdocs: + image: "decentral1se/kawaiipunk.xyz:v0.1.0" + networks: + - proxy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000"] + interval: 10s + timeout: 10s + retries: 10 + start_period: 5s + deploy: + update_config: + failure_action: rollback + order: start-first + labels: + - "traefik.enable=true" + - "traefik.http.services.mkdocs.loadbalancer.server.port=8000" + - "traefik.http.routers.mkdocs.rule=Host(`kawaiipunk.xyz`)" + - "traefik.http.routers.mkdocs.entrypoints=web-secure" + - "traefik.http.routers.mkdocs.tls.certresolver=production" + +networks: + proxy: + external: true