Creates a Docker setup to run qbreader locally, for development purposes.
-
Clone the repository and go to working directory e.g.
git clone https://github.com/benjiec/qbreader-docker && cd qbreader-docker -
Create
qbreader/website. e.g.git clone https://github.com/qbreader/websiteIf you are doing your own development, you will want to clone from the appropriate forked repo.
-
Clone
qbreader/database. e.g.git clone https://github.com/qbreader/databaseIf you are doing your own development, you will want to clone from the appropriate forked repo.
-
Download a backup copy of the database and put that in
dump/qbreader. This directory should contain the various.bsonfiles. E.g. visithttps://www.qbreader.org/db/backups, visit the backup Google Drive, download one of the timestamped directories as a zip file, and unzip and copy the.bsonfiles todump/qbreader. -
Build docker images and start docker instances using
docker compose up -d --build -
Populate local MongoDB server with backup
BACKUP_DIR=/<full-path-to-parent-dir>/qbreader-docker/dump ./scripts/setup-db.sh
-
docker-compose up -d -
Visit
localhost:3000from a browser
The following commands are handy.
Rebuild assets (e.g. scss)
docker-compose exec website npm run build
Or rebuild whole image for website if dependencies have changed
docker-compose build
docker-compose up -d
Restart qbreader website
docker-compose restart website
Monitor logs
docker-compose logs -f
docker-compose logs -f website