The following steps describe how to set up the Quassel application system.
These steps describe how to set up the system environment on Ubuntu 24.04 LTS:
-
Install updates
apt update && apt upgrade
-
Install Docker dependencies
apt install apt-transport-https ca-certificates curl gnupg lsb-release
-
Import Dockers GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
-
Add Dockers apt repository
-
On x86_64
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
-
On ARM
echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
-
-
Install Docker
apt update && apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
-
Validate the installation of Docker (>=
27.3.1
)docker version
-
Validate the installation of Docker Compose (>=
2.29.6
)docker compose version
The following sources were used:
The following steps describe how to set up the application system:
-
Copy the example files
cd /srv \ && wget https://raw.githubusercontent.com/openscript-ch/quassel/refs/heads/main/examples/public/docker-compose.yaml \ && wget https://raw.githubusercontent.com/openscript-ch/quassel/refs/heads/main/examples/public/traefik.yaml \ && wget https://raw.githubusercontent.com/openscript-ch/quassel/refs/heads/main/examples/public/.env.example
-
Rename environment file and fill out the gaps
mv .env.example .env
-
Make sure that the DNS is routing all subdomains to the host where the individual services run on.
-
Replace all
example.com
with the domain where the application runs on.sed -i "s/example.com/example.com/g" docker-compose.yaml
-
Change contact email for SSL certificates in
traefik.yaml
-
Configure the following environment variables in
docker-compose.yaml
:- backend:
SESSION_SECRET
to a 32byte random hex string withopenssl rand -hex 32
SESSION_SALT
to a 8byte random hex string withopenssl rand -hex 8
DATABASE_PASSWORD
set a more secure password for the database
- frontend:
API_URL
point to the API endpoint (e.g. "https://api.test.example.com")
- backend:
-
Run application system
docker compose -f docker-compose.yaml up -d
For automatic updates, there is a watchtower service configured. This service exposes an endpoint at http://test.example.com:8080/v1/update
. If a HTTP GET request is sent including the configured secret Bearer token to this endpoint, watchtower will pull new images and restart the services accordingly.
The following opinionated steps describe to push data to a Grafana instance via Prometheus:
-
Get the remote url and token.
-
Enable Docker Metrics.
-
Add the following to the Docker daemon configuration file
/etc/docker/daemon.json
:{ "metrics-addr" : "localhost:9323" }
-
Restart the Docker daemon with
systemctl restart docker
.
-
-
Copy the Grafana Agent configuration example:
wget https://raw.githubusercontent.com/openscript-ch/quassel/refs/heads/main/examples/public/grafana-agent.yaml
-
Replace the
remote_write
url and token ingrafana-agent.yaml
.<endpoint>
with the remote url.<token>
with the token.
The following sections describe the tasks to take care of the application system.
- Merge the release pull request and wait for completion of the pipeline.
-
Pull new images
docker compose -f docker-compose.yaml pull
-
Recreate containers
docker compose -f docker-compose.yaml up -d
-
Migrate database
docker exec -it $(docker ps -f name=backend -q) npx mikro-orm migration:up
-
Seed database
docker exec -it $(docker ps -f name=backend -q) npx mikro-orm seeder:run
-
Create a database backup
docker exec -it $(docker ps -f name=database -q) pg_dumpall -c -U postgres > quassel_dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
-
Archive storage