Repository navigation
Docker (self compiled)
This guide details the Self-Compiled & Classic CLI-First Docker Deployment for hroot. This method is recommended when you want to modify the source code, add custom features/styling, build from custom Git forks, or perform automated headless server provisioning (e.g. via Ansible or scripts).
In this mode, Docker compiles the application image directly on your server from the local source code and Dockerfile. All environment variables are pre-configured in .env before container launch.
-
When to Choose This Method:
- Custom Code & Feature Modifications: If your laboratory needs custom modifications in Rails controllers, views, or business logic, building from source compiles your local code directly into the container.
- Custom Corporate Design / Assets: If you are adding institutional logos, custom CSS overrides, or localized templates directly into the source tree.
- Local Development & Testing: Immediate local compilation of new branches or uncommitted changes without waiting for CI/CD pipelines.
-
Headless / Automated Deployments: If your IT infrastructure uses Ansible, Terraform, or Puppet to pre-populate
.envfiles and provision containers automatically.
-
Install Docker and Docker Compose v2:
sudo apt update sudo apt install docker-compose-v2 sudo usermod -aG docker $USER # Log out and back in to apply
-
Clone the
hrootRepository:git clone https://github.com/wiso-forschungslabor/hroot.git cd hroot
Run the included helper script to copy .env.example to .env and automatically generate cryptographic keys:
./bin/init-envThis generates a secure SECRET_KEY_BASE, WebPush VAPID keypair, and randomized MySQL database passwords.
Open .env in your preferred editor (e.g. nano .env) to customize your configuration:
-
APP_DOMAIN: Your server hostname (e.g.hroot.example.orgorlocalhost). -
CONTACT_EMAIL: Laboratory support/contact email address. -
DATABASE_*: Database credentials (if connecting to an external database). -
SMTP_*: Outgoing mail server configuration. - (See Environment Configuration for the complete variable catalog).
Compile the Docker image locally and start the services in background:
docker compose up -d --build(The --build flag ensures that your local source code, gems, and assets are freshly compiled into the image).
Initialize the MySQL schema, load lookup tables, and create the initial banking administrator account via CLI:
docker compose exec web bin/docker-setupDepending on your server architecture, you can apply Compose override files:
docker compose up -d --builddocker compose -p <project-name> -f docker-compose.yml -f docker/overrides/shared-proxy.yml up -d --build(See Docker Multi-Instance Setup for central reverse proxy configuration).
docker compose -f docker-compose.yml -f docker/overrides/app-only.yml up -d --builddocker compose -f docker-compose.yml -f docker/overrides/ext-db.yml up -d --buildWhen you update or customize the code in your repository, recompile the container image:
# 1. Pull or edit your code changes
git pull
# 2. Rebuild and restart containers
docker compose up -d --build
# 3. Run any new database migrations if applicable
docker compose exec web bin/rails db:migrateAll services in docker-compose.yml are configured with restart: unless-stopped.
-
Behavior on Host Reboot:
- When the Linux host reboots, systemd starts the Docker daemon (
docker.service), which immediately restores all containers that were running prior to reboot. - If containers were manually stopped with
docker compose downordocker compose stop, Docker keeps them stopped across reboots.
- When the Linux host reboots, systemd starts the Docker daemon (
-
Service Management via systemd:
- To integrate the Compose stack into host-level service management, see the systemd unit setup detailed in Docker (precompiled) (
hroot.service).
- To integrate the Compose stack into host-level service management, see the systemd unit setup detailed in Docker (precompiled) (
After initial launch and administrator creation, follow the First steps after installation checklist to configure participant pools, custom fields, notification templates, and finance settings in the Site Settings web UI.
-
-
Subject pool and user management
-
Experiment management