Working! 🥳
continuous-integration/drone/push Build is failing Details

This commit is contained in:
3wc 2020-10-02 14:15:51 +02:00
parent f6d9640051
commit dcdc7560f7
4 changed files with 79 additions and 18 deletions

View File

@ -6,14 +6,18 @@ steps:
image: decentral1se/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: adapt_authoring
stack: adaptauthoring
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
environment:
DOMAIN: adapt-authoring.swarm-test.autonomic.zone
STACK_NAME: adapt_authoring
DOMAIN: adaptauthoring.swarm-test.autonomic.zone
STACK_NAME: adaptauthoring
LETS_ENCRYPT_ENV: production
ADMIN_EMAIL: adapt@example.com
FROM_EMAIL: adapt@example.com
SESSION_KEY_VERSION: v1
ADMIN_PASSWORD_VERSION: v1
trigger:
branch:
- main

View File

@ -1,4 +1,11 @@
export SERVICE=adapt-authoring
export DOMAIN=adapt-authoring.example.com
export STACK_NAME=adapt_authoring
export SERVICE=adaptauthoring
export STACK_NAME=adaptauthoring
export DOMAIN=adapt.example.com
export LETS_ENCRYPT_ENV=production
export ADMIN_EMAIL=adapt@example.com
export FROM_EMAIL=adapt@${DOMAIN}
export SESSION_KEY_VERSION=v1
export ADMIN_PASSWORD_VERSION=v1

View File

@ -1,4 +1,4 @@
# Adapt_authoring
# Adapt Authoring Tool
User interface for authoring eLearning courses using the Adapt framework • https://github.com/adaptlearning/adapt_authoring
@ -10,8 +10,13 @@ User interface for authoring eLearning courses using the Adapt framework • htt
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`
5. Generate secrets:
```
abra secret_generate admin_password v1
abra secret_generate secret_key v1
```
6. `direnv allow` (or `. .envrc`)
7. `abra deploy`
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`compose-stacks/traefik`]: https://git.autonomic.zone/compose-stacks/traefik

View File

@ -3,27 +3,72 @@ version: "3.8"
services:
app:
image: nginx:1.19.2
image: 3wordchant/adaptauthoring:0.10.4
#entrypoint: ['tail', '-f', '/dev/null']
networks:
- proxy
- internal
environment:
- PORT=5000
- DOMAIN
- DB_HOST=db
- DB_NAME=adapt
- DB_USER=adapt
#- DB_PASSWORD_FILE=/var/run/secrets/db_password
- SESSION_KEY_FILE=/var/run/secrets/session_key
- ADMIN_EMAIL
- ADMIN_PASSWORD_FILE=/var/run/secrets/admin_password
- FROM_EMAIL
depends_on:
- db
volumes:
- app:/adapt_authoring
secrets:
#- db_password
- session_key
- admin_password
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
interval: 30s
timeout: 10s
retries: 10
start_period: 5m
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.services.${STACK_NAME}.loadbalancer.server.port=5000"
- "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
- "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}"
db:
image: mongo:3.6
volumes:
- db:/data/db
networks:
- internal
labels:
- "traefik.enable=false"
networks:
proxy:
external: true
internal:
volumes:
app:
db:
secrets:
session_key:
external: true
name: ${STACK_NAME}_session_key_${SESSION_KEY_VERSION}
admin_password:
external: true
name: ${STACK_NAME}_admin_password_${ADMIN_PASSWORD_VERSION}