Self-hosting / Cluster mode
Cluster mode
Spread the checks over several workers. The job queue lives in PostgreSQL, so no extra service is needed.
In cluster mode, the main image serves the web interface and the API, and workers run the checks. The workers share a job queue stored in PostgreSQL, so no extra service is needed.
Set up the application
Run the uptime-kotlin image with SCHEDULER_STRATEGY: none. It no longer runs checks itself, and it can be replicated behind a load balancer.
Add workers
Add one service per worker with the worker image:
YAML
uptime-kotlin-worker:
image: ghcr.io/theomeunier/uptime-kotlin/worker:latest
container_name: uptime_kotlin_worker
restart: unless-stopped
environment:
TZ: Europe/Paris
SCHEDULER_STRATEGY: database
SCHEDULER_WORKER_NAME: worker-primary
SCHEDULER_WORKER_CONCURRENCY: '4'
QUARKUS_DATASOURCE_USERNAME: uptime-kotlin
QUARKUS_DATASOURCE_PASSWORD: change-me
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://postgres:5432/uptime-kotlin
ENCRYPTION_MASTER_KEY: change-me-32-characters-minimum-0
depends_on:
- uptime-kotlinSCHEDULER_WORKER_NAME must be unique per worker. Checks left by a stopped worker are picked up by the others after 30 seconds.
The workers must use the same ENCRYPTION_MASTER_KEY as the application, and the same maintenance and notification settings (see Configuration).
