These are the procedures for running the Quorum website using docker. This file describes the steps necessary to get the system running from first principles.
The following software is needed to compile the whole stack:
- Docker Desktop: https://www.docker.com/products/docker-desktop
Three repositories need to be cloned. One is public, quorum-language, while the other two are private: quorum-support and quorum-server. All 3 must go in the same parent folder.
- Quorum Server: https://github.com/qorf/quorum-server.git
- This contains all the docker related files and scripts
- docker-compose.yml is the main file, with one additional for PHP dependencies
- The env-dev file contains environment variables and must be renamed to .env for deployment or local servers.
- Quorum Website: https://github.com/qorf/quorum-website.git
The website clone must be done within quorum-server, as the setup scripts in the compose file will attempt to build the website from this location.
- Clone the quorum-server repository
- Clone the quorum-website repository inside the quorum-server repository
- Either change the .yml file to use the non-production version of the conf file or generate self-signed certificates and place them in the folder named "secret." One command for doing this is listed in Common Issues.
- Copy the default environment file for the local server and change it if used in production (e.g., cp env-dev .env).
- Use the terminal and go to the quorum-server location, then type docker-compose up. The -d may be used to run the server in daemon mode.
Sometimes Docker was unable to find or load a specific image from docker hub. I'm not sure if this has anything to do with firewalls or dns issues, but I found removing the version tags to help.
For Example: Change image: IMAGE:VERSION-TAG to image: IMAGE
If you're on windows, and the script fails, it may not be able to connect to the background docker process. (Perhaps hanging or frozen in the background)
Try either rebooting or restarting the Docker Desktop app, hopefully that resolves the issue.
Also, sometimes WSL 2 loses access to the windows file system, resulting in a broken terminal environment where almost nothing can be found suddenly. I could only resolve this by rebooting my machine. It's very frustrating and occurs randomly, not sure why it occurs though.
The server requires your host machine ports to line up with the internal docker ports. Ideally in the future all networking would be handled within the docker image and containers. For now, make sure to have a nginx map ports 80:80 and 443:443
This issue seems to come and go for me and random machines, and am not totally sure how to prevent it yet.
If you end up facing this as well, I suggest to try deleting Docker's Cached images.
docker builder prune -a
In the latest version of the Quorum server, Redis is used inside of the PHP module. If you are upgrading the server from a previous one, using docker-compose up -d will not include it, leading to errors. The PHP module needs a rebuild, which we can do with the following command:
docker-compose build --no-cache php
If docker compose is hanging on a droplet, it might indicate there is not enough entropy. We can check this by running:
cat /proc/sys/kernel/random/entropy_avail
To fix this, we can install haveged. We can do this with this command:
apt-get install haveged
To get a copy of the database run the following:
docker exec -i database mysqldump -u<username> -p<password> stefika_sodbeans_users > backup.sql
To get just the schema and not get data you can run this command:
docker exec -i database mysqldump -u<username> -p<password> --no-data stefika_sodbeans_users > schema.sql
With a copy of the schema or database, run the following to install into your local machine:
docker exec -i database mysql -u<username> -p<password> stefika_sodbeans_users < backup.sql
You can use the following command:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -nodes -days 365
This generates two files, key.pem and cert.pem, which are sufficiently for a self-signed certificate on a local machine. They go in the folder /secret.
How do I make a local quorum version on my machine for testing a custom version of the standard library?
We follow these steps:
- Clone the latest version of Quorum or do a pull on the branch of interest
- Run RunLibrary.quorum to generate the latest version and do a standard library override in Quorum Studio
- Close and restart Quorum Studio
- Set to Main.quorum and do a clean and build
- Run Quorum/build_local_image.sh in the quorum-language repository
- In docker-compose.yml, change image: andreasstefik/quorum:10.0.2 to image: local_quorum
- Do a normal docker-compose down and docker-compose up -d