commit 5f9817901c4aa055e86e59e69c85b00701d7b170 Author: Cooperative Cloud <> Date: Sun Nov 15 03:02:10 2020 +0100 Initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4165b88 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,19 @@ +--- +kind: pipeline +name: deploy to swarm-test.autonomic.zone +steps: + - name: deployment + image: decentral1se/stack-ssh-deploy:latest + settings: + host: swarm-test.autonomic.zone + stack: statuspal + purge: true + deploy_key: + from_secret: drone_ssh_swarm_test + environment: + DOMAIN: statuspal.swarm-test.autonomic.zone + STACK_NAME: statuspal + LETS_ENCRYPT_ENV: production +trigger: + branch: + - main diff --git a/.envrc.sample b/.envrc.sample new file mode 100644 index 0000000..8ce5b02 --- /dev/null +++ b/.envrc.sample @@ -0,0 +1,6 @@ +export APP=statuspal + +export DOMAIN=statuspal.example.com +## Domain aliases +#export EXTRA_DOMAINS=', `www.statuspal.example.com`' +export LETS_ENCRYPT_ENV=production diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37b52cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.envrc diff --git a/README.md b/README.md new file mode 100644 index 0000000..eea6414 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Statuspal + +Statuspal lets you communicate your web apps/services status • https://github.com/statuspal/statuspal/ + +## Basic usage + +1. Set up Docker Swarm and [`abra`] +2. Deploy [`compose-stacks/traefik`] +3. `git clone https://git.autonomic.zone/coop-cloud/statuspal.git && cd statuspal` +3. `cp .envrc.sample .envrc` +4. Edit `.envrc` - be sure to change `DOMAIN` to something that resolves to + your Docker swarm box +5. `direnv allow` (or `. .envrc`) +6. `abra deploy` + +[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra +[`compose-stacks/traefik`]: https://git.autonomic.zone/compose-stacks/traefik diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..662a96c --- /dev/null +++ b/compose.yml @@ -0,0 +1,31 @@ +--- +version: "3.8" + +services: + app: + image: nginx:1.19.2 + networks: + - proxy + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" + - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" + ## Redirect from EXTRA_DOMAINS to DOMAIN + #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost"] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m + +networks: + proxy: + external: true