Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LSIO BookStack & Swag Setup

This is a tested setup of using LSIO Swag with LSIO's BookStack container

Environment

This was my environment and are therefore details you'll need to change:

  • I was using lsiotesting.danb.me as the main domain for swag.
  • I was hosting bookstack on a subdomain of that (bookstack.lsiotesting.danb.me).
  • I was storing my docker mounted files at /root/docker (Verly likely bad practice but was easy place for testing).

I was on a fresh Ubuntu 20.04.1 instance on digitalocean, with docker.io and docker-compose installed via apt.

Actions Taken

  1. I pointed both my main domain (lsiotesting.danb.me) and my bookstack domain (bookstack.lsiotesting.danb.me) at my server IP address.
  2. I added the above docker-compose.yml onto the server.
  3. I ran docker-compose up with the above compose.
  4. After a few mins, once the output of (3) had calmed down (After it had migrated the bookstack database and fetched the HTTPS certs) I stopped docker-compose to bring down the containers.
  5. Within the $SWAG_MOUNT_FOLDER_PATH/nginx/proxy-confs folder, I activated the bookstack config: mv bookstack.subdomain.conf.sample bookstack.subdomain.conf
  6. I restarted the containers.
  7. BookStack instance all live on https at https://bookstack.lsiotesting.danb.me.
---
version: "2.1"
services:
swag:
image: ghcr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- URL=lsiotesting.danb.me
- SUBDOMAINS=bookstack
- VALIDATION=http
- EMAIL=domains@example.com
- ONLY_SUBDOMAINS=false
volumes:
- /root/docker/swag:/config
ports:
- 443:443
- 80:80
restart: unless-stopped
bookstack:
image: ghcr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=https://bookstack.lsiotesting.danb.me
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS=super_secret_db_pass
- DB_DATABASE=bookstackapp
volumes:
- /root/docker/bookstack:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: ghcr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=super_secret_root_pass
- TZ=Europe/London
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=super_secret_db_pass
volumes:
- /root/docker/maria:/config
restart: unless-stopped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment