Compare commits

...

5 Commits

Author SHA1 Message Date
3wc 547068bb48 Bump Adapt to 0.10.5 2020-11-20 11:59:44 +02:00
3wc 4b972903dd Disable `node upgrade` during launch 2020-11-20 11:59:31 +02:00
3wc 11d767b20f Update README, reinstate backups & clean-up 2020-10-03 17:01:31 +02:00
3wc 1afef99027 hardcoding → env file, tweak entrypoint 2020-10-02 19:24:02 +02:00
3wc c1b26a5747 Update README 2020-10-02 18:27:20 +02:00
4 changed files with 58 additions and 24 deletions

View File

@ -1,6 +1,6 @@
FROM node:12.18.4-stretch
ENV AAT_VER=0.10.4
ENV AAT_VER=0.10.5
RUN apt-get update && apt-get install -y \
build-essential \

View File

@ -2,9 +2,9 @@
![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/3wordchant/adaptauthoring)
Authoring SCORM-compatible training using the [Adapt Authoring](https://github.com/adaptlearning/adapt_authoring) tool.
Docker configuration for the [Adapt Authoring tool](https://github.com/adaptlearning/adapt_authoring): create SCORM-compatible training.
## How to use this image
## Getting started
Because Adapt requires a database to run, the easiest way to get started is to use `docker-compose` to set up Adapt and MongoDB automatically.
@ -16,7 +16,9 @@ Edit the variables under `services.app.environment`, then push the button!
docker-compose up
## Environment variables
## Configuration
### Environment variables
You can configure Adapt's initial set-up using these variables:
@ -30,10 +32,57 @@ You can configure Adapt's initial set-up using these variables:
- `ADMIN_PASSWORD` - password for the default superuser account
- `FROM_EMAIL` - `From:` email address for notifications
## Docker secrets
(If you edit these settings after set-up, you'll need to manually edit
`/adapt_authoring/conf/config.json` with the new values as well)
### Docker secrets
As well as environment variables, you can also load `SESSION_SECRET` and
`ADMIN_PASSWORD` from files, which is helpful if want to keep secret data in
`ADMIN_PASSWORD` from files, which is helpful if you want to keep secret data in
[Docker swarm mode secrets](https://docs.docker.com/engine/swarm/secrets).
Simply set `SESSION_SECRET_FILE` / `ADMIN_PASSWORD_FILE`.
## Clean Up
### To remove containers
```
docker-compose down
```
### To remove data (courses)
This will delete your hard work.
```
docker volume rm dockeradaptauthoring_adaptdb
docker volume rm dockeradaptauthoring_adaptdata
```
## Backup
Create local archives of both the `adapt_authoring` folder and database:
docker run -it -w /backup -v dockeradaptauthoring_adaptdb:/adaptdb \
-v $(pwd)/backup:/backup dockeradaptauthoring_authoring \
bash -c "tar -czvf adaptdata_`date +"%Y-%m-%d_%H-%M-%S"`.tar.gz /adapt_authoring && tar -czvf adaptdb_`date +"%Y-%m-%d_%H-%M-%S"`.tar.gz /adaptdb"
## Deployment
### Docker Swarm
See [`coop-cloud/adapt_authoring`] for an example Docker "swarm mode"
configuration, including secrets, SSL reverse proxy, and continuous integration
tests of the stack deployment.
## Troubleshooting
- If you run the installer script many times in quick succession, you might get
rate-limited by Github (the script checks Github for the latest Adapt
Authoring version, and to clone the Authoring Framework and plug-ins). Wait
an hour, or use a VPN.
- `node upgrade` doesn't work, because code is downloaded as a ZIP archive
instead of using a `git clone`
[`coop-cloud/adapt_authoring`]: https://git.autonomic.zone/coop-cloud/adapt_authoring/

View File

@ -2,6 +2,7 @@ version: '2'
services:
app:
container_name: adapt
image: 3wordchant/adaptauthoring:0.10.4
build: .
volumes:
@ -14,16 +15,7 @@ services:
- "5000:5000"
networks:
- internal
environment:
- PORT=5000
- DOMAIN=adapt.localhost
- DB_HOST=db
- DB_NAME=adapt
- DB_USER=adapt
- SESSION_SECRET=foobar
- ADMIN_EMAIL=foo@bar.com
- ADMIN_PASSWORD=foo
- FROM_EMAIL=adapt@localhost
env_file: .env
db:
container_name: adaptdb

View File

@ -28,7 +28,7 @@ load_vars() {
}
install_adapt() {
echo "No 'conf' dir found, installing Adapt"
echo "No 'conf' dir found, running 'node install...'"
# 3wc: use `yes` to skip the dbPass and dbAuthSource prompts
yes "" | node install --install Y \
--authoringToolRepository https://github.com/adaptlearning/adapt_authoring.git \
@ -50,11 +50,6 @@ install_adapt() {
#--smtpUsername "${SMTP_USERNAME}" --smtpPassword "${SMTP_PASSWORD}" \
}
update_adapt() {
echo "Upgrade Adapt Authoring Tool & Framework"
node upgrade --continue Y --updateAutomatically Y
}
main() {
set -eu
@ -62,8 +57,6 @@ main() {
if [ ! -d conf ]; then
install_adapt
else
update_adapt
fi
}