From 70abb65d31cae3795245ab133b177e3bb129a68b Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 9 Nov 2026 16:34:10 -0700 Subject: [PATCH] Dawarich 1.17.0: background jobs move into the app container Follows the 1.17.0 upgrade notes and upstream compose: the separate dawarich_sidekiq service is gone (removed on the host before deploying), the app runs Sidekiq embedded (SIDEKIQ_EMBEDDED=true, WEB_CONCURRENCY=0, BACKGROUND_PROCESSING_CONCURRENCY=2), gets stop_grace_period 60s, and the limits match upstream (1 CPU, 4G). Fresh dump before this step: ~/backups/dawarich-1.16.0-20261109. Co-Authored-By: Claude Opus 5.5 --- group_vars/docker/services.yml | 2 +- roles/docker/README.md | 2 +- .../docker/templates/dawarich-compose.yml.j2 | 63 +++---------------- 3 files changed, 11 insertions(+), 56 deletions(-) diff --git a/group_vars/docker/services.yml b/group_vars/docker/services.yml index 0dbf9bf..7e2cadd 100644 --- a/group_vars/docker/services.yml +++ b/group_vars/docker/services.yml @@ -36,4 +36,4 @@ paperless_version: "latest" # Dawarich image tag. Pinned while stepping through the 1.7 -> 1.22 upgrade # (stops: 1.10.3, 1.14.5, 1.16.0, 1.17.0 compose change, 1.18.1, 1.22.0). # Go back to "latest" plus the dockcheck label once on 1.22.0. -dawarich_version: "1.16.0" +dawarich_version: "1.17.0" diff --git a/roles/docker/README.md b/roles/docker/README.md index be5c5bc..34b3bfc 100644 --- a/roles/docker/README.md +++ b/roles/docker/README.md @@ -49,7 +49,7 @@ Tags: each category file has a category tag, each service its own tag. | `baikal` | Baikal | CalDAV/CardDAV. Caddy redirects the `.well-known` paths. | | `syncthing` | Syncthing | Ports on the Tailscale IP only. | | `heyform` | HeyForm v3 | `latest` (stable releases only), auto-updated. MongoDB 7.0 (Percona) and Redis 8 (v3 needs it). Port 9157. Public sign-up is off; people join through workspace invitations. On `forms.nerder.land`. | -| `dawarich` | Dawarich | App, Sidekiq, PostGIS, Redis. Based on the upstream production compose file. Image tag from `dawarich_version` (pinned during the 1.7 → 1.22 step-by-step upgrade). | +| `dawarich` | Dawarich | App (with embedded Sidekiq since 1.17.0), PostGIS, Redis. Based on the upstream production compose file. Image tag from `dawarich_version` (pinned during the 1.7 → 1.22 step-by-step upgrade). | | `obsidian-livesync` | CouchDB for Obsidian LiveSync | Port 5984 on the Tailscale IP only. Has a restart handler. | | `gokapi` | Gokapi | Pocket ID login. `config.json` is only written on a fresh install, because Gokapi rewrites it on upgrade. To change it, delete `/opt/stacks/gokapi/config/config.json` and redeploy. | diff --git a/roles/docker/templates/dawarich-compose.yml.j2 b/roles/docker/templates/dawarich-compose.yml.j2 index c69a059..2883ee4 100644 --- a/roles/docker/templates/dawarich-compose.yml.j2 +++ b/roles/docker/templates/dawarich-compose.yml.j2 @@ -41,6 +41,8 @@ services: entrypoint: web-entrypoint.sh command: ['bin/rails', 'server', '-p', '3000', '-b', '::'] restart: unless-stopped + # Background jobs run inside this container since 1.17.0; give them time to stop + stop_grace_period: 60s environment: RAILS_ENV: production DATABASE_HOST: dawarich_db @@ -62,6 +64,10 @@ services: PROMETHEUS_EXPORTER_PORT: 9394 SECRET_KEY_BASE: {{ vault_dawarich.secret_key_base }} RAILS_LOG_TO_STDOUT: "true" + # 1.17.0 merged the sidekiq container into the app + SIDEKIQ_EMBEDDED: 'true' + WEB_CONCURRENCY: '0' + BACKGROUND_PROCESSING_CONCURRENCY: 2 logging: driver: "json-file" options: @@ -83,60 +89,9 @@ services: deploy: resources: limits: - cpus: '0.50' - memory: '2G' - dawarich_sidekiq: - image: freikin/dawarich:{{ dawarich_version }} - container_name: dawarich_sidekiq - volumes: - - dawarich_public:/var/app/public - - dawarich_watched:/var/app/tmp/imports/watched - - dawarich_storage:/var/app/storage - stdin_open: true - tty: true - entrypoint: sidekiq-entrypoint.sh - command: ['sidekiq'] - restart: unless-stopped - environment: - RAILS_ENV: production - DATABASE_HOST: dawarich_db - DATABASE_PORT: 5432 - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: {{ vault_dawarich.postgres_password }} - DATABASE_NAME: dawarich_production - REDIS_URL: redis://dawarich_redis:6379 - MIN_MINUTES_SPENT_IN_CITY: 60 - APPLICATION_HOSTS: {{ subdomains.loclog }},localhost,::1,127.0.0.1 - TIME_ZONE: America/Denver - APPLICATION_PROTOCOL: http - DISTANCE_UNIT: mi - PHOTON_API_HOST: photon.dawarich.app - PHOTON_API_KEY: ca91825827603b39e4cdd6fe4de9063f4ec77e0617454857576dd62b424bb60b - PHOTON_API_USE_HTTPS: true - PROMETHEUS_EXPORTER_ENABLED: false - SECRET_KEY_BASE: {{ vault_dawarich.secret_key_base }} - RAILS_LOG_TO_STDOUT: "true" - logging: - driver: "json-file" - options: - max-size: "100m" - max-file: "5" - healthcheck: - test: ["CMD-SHELL", "ps aux | grep '[s]idekiq' || exit 1"] - interval: 10s - retries: 30 - start_period: 30s - timeout: 10s - depends_on: - dawarich_app: - condition: service_healthy - restart: true - dawarich_db: - condition: service_healthy - restart: true - dawarich_redis: - condition: service_healthy - restart: true + cpus: '1.00' + memory: '4G' + volumes: dawarich_db_data: dawarich_redis_data: