Bookwyrm
Bookwyrm is a federated book sharing webapp.
Quick links
Anatomy
Our Bookwyrrm instance is hosted on the solarpunk.moe OVH box, and uses docker compose. The directory it is deployed from is /home/vivi/bookwyrm/. It uses Traefik.
The docker compose setup is straightforward, but no images exist so we need to build them manually. However, the bookwyrm image is not CPU intensive like Mastodon is, so it's safe to build it directly on the box.
As a result, we have the bookwyrm repo cloned into that directory.
Most of the administration is done with the handy ./bw-dev script.
First-time setup
Prerequisites
This config expects the following on the server:
docker group, so that it can manage docker without sudo. [this effectively grants root access to the user, so grant this with care]
Traefik installed, running on the httpsproxy docker network.
Sendmail installed in the mail docker network (though generally that goes to spam with email hosts like Gmail).Creds for a S3-compatible bucket at digitaloceanspaces.com with the name solarpunk. The keys for the instance
Setup
Our setup will be very close to the official Docker instructions, but using our .env file and customized docker-compose.yml.
Clone our repository somewhere separate from where you want to deploy this docker compose stack.
Clone the official bookwyrm repository at the location you want to deploy to.
Copy over the docker-compose.yml and .env file from the solarpunk repository to the bookwyrm repository.
Fill in the secrets in the .env file. Time to build the image.
./bw-dev build
Then run setup:
./bw-dev setup
Now you probably want to restore the database from a backup.
cat some_backup.sql | ./bw-dev exec db psql -U fedireads
And then finally, start it up:
./bw-dev up -d
As mentioned in the updating guide, the main container takes a while to start up the first time due to collecting static files and building the themes.
Updating
To update, I follow a simple strategy. First, I stash the local changes (mostly to the docker-compose.yml), and pull the updates on the production branch:
git stash
git pull
git stash pop
Then generally there are conflicts in the docker-compose.yml. Open it in a text editor and resolve them (don't let the anubis or certbot configurations come back -- those are all handled externally at the Traefik layer). Make sure you understand how git conflict files are structured so you don't mess up the docker-compose.yml with a bad merge.
git add docker-compose.yml and git status to make sure there are no leftover conflicted files.
Now, build:
./bw-dev build
It will take a couple minutes to install everything.
Now migrate the DB:
./bw-dev migrate
And, start it up:
./bw-dev up -d
Note that the newly created containers will take a while to start up, as some compiling of themes happens as well as collecting of static files.