From f6d964005119dc5e0abf4b8d15a378f85bc0d67c Mon Sep 17 00:00:00 2001 From: Compose Stacks <> Date: Thu, 1 Oct 2020 22:21:57 +0200 Subject: [PATCH] Initial commit --- .drone.yml | 19 +++++++++++++++++++ .envrc.sample | 4 ++++ .gitignore | 1 + README.md | 17 +++++++++++++++++ compose.yml | 29 +++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 .drone.yml create mode 100644 .envrc.sample create mode 100644 .gitignore create mode 100644 README.md create mode 100644 compose.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..9b8c453 --- /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: adapt_authoring + purge: true + deploy_key: + from_secret: drone_ssh_swarm_test + environment: + DOMAIN: adapt-authoring.swarm-test.autonomic.zone + STACK_NAME: adapt_authoring + LETS_ENCRYPT_ENV: production +trigger: + branch: + - main diff --git a/.envrc.sample b/.envrc.sample new file mode 100644 index 0000000..1c276c1 --- /dev/null +++ b/.envrc.sample @@ -0,0 +1,4 @@ +export SERVICE=adapt-authoring +export DOMAIN=adapt-authoring.example.com +export STACK_NAME=adapt_authoring +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..a3a6ad1 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Adapt_authoring + +User interface for authoring eLearning courses using the Adapt framework • https://github.com/adaptlearning/adapt_authoring + +## Basic usage + +1. Set up Docker Swarm and [`abra`] +2. Deploy [`compose-stacks/traefik`] +3. `git clone https://git.autonomic.zone/compose-stacks/adapt_authoring.git && cd adapt_authoring` +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..81fcc49 --- /dev/null +++ b/compose.yml @@ -0,0 +1,29 @@ +--- +version: "3.8" + +services: + app: + image: nginx:1.19.2 + networks: + - proxy + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.docker.network=proxy" + - "traefik.http.routers.${STACK_NAME}.tls=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" + - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost"] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m + +networks: + proxy: + external: true