diff --git a/CLAUDE.md b/CLAUDE.md index da54295..69b9fcf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -111,4 +111,7 @@ extra_hosts: Common domains requiring hairpinning fixes: - `auth.thesatelliteoflove.com` (Authentik SSO) - `cal.thesatelliteoflove.com` (Baikal CalDAV) -- Any service domain the container needs to communicate with \ No newline at end of file +- Any service domain the container needs to communicate with + +### Service-Specific Reference Configurations +- **Dawarich**: Based on production compose file at https://github.com/Freika/dawarich/blob/master/docker/docker-compose.production.yml \ No newline at end of file diff --git a/roles/docker/templates/dawarich-compose.yml.j2 b/roles/docker/templates/dawarich-compose.yml.j2 index 37c2e45..385e08c 100644 --- a/roles/docker/templates/dawarich-compose.yml.j2 +++ b/roles/docker/templates/dawarich-compose.yml.j2 @@ -1,20 +1,4 @@ services: - dawarich_redis: - image: redis:7.4-alpine - container_name: dawarich_redis - command: redis-server - volumes: - - dawarich_redis_data:/var/shared/redis - restart: always - healthcheck: - test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] - interval: 10s - retries: 5 - start_period: 30s - timeout: 10s - labels: - glance.parent: dawarich - glance.name: Redis dawarich_db: image: postgis/postgis:17-3.5-alpine shm_size: 1G @@ -36,7 +20,7 @@ services: start_period: 30s timeout: 10s dawarich_app: - image: freikin/dawarich:latest + image: freikin/dawarich:0.27.3 container_name: dawarich_app labels: glance.name: Dawarich @@ -47,6 +31,8 @@ services: volumes: - dawarich_public:/var/app/public - dawarich_watched:/var/app/tmp/imports/watched + - dawarich_storage:/var/app/storage + - dawarich_db_data:/dawarich_db_data stdin_open: true tty: true entrypoint: web-entrypoint.sh @@ -54,7 +40,8 @@ services: restart: on-failure environment: RAILS_ENV: production - REDIS_URL: redis://dawarich_redis:6379/0 + QUEUE_DATABASE_PATH: /dawarich_db_data/dawarich_production_queue.sqlite3 + CACHE_DATABASE_PATH: /dawarich_db_data/dawarich_production_cache.sqlite3 DATABASE_HOST: dawarich_db DATABASE_PORT: 5432 DATABASE_USERNAME: postgres @@ -85,77 +72,16 @@ services: dawarich_db: condition: service_healthy restart: true - dawarich_redis: - condition: service_healthy - restart: true deploy: resources: limits: cpus: '0.50' # Limit CPU usage to 50% of one core memory: '2G' # Limit memory usage to 2GB - dawarich_sidekiq: - image: freikin/dawarich:latest - container_name: dawarich_sidekiq - labels: - glance.parent: dawarich - glance.name: Sidekiq - volumes: - - dawarich_public:/var/app/public - - dawarich_watched:/var/app/tmp/imports/watched - stdin_open: true - tty: true - entrypoint: sidekiq-entrypoint.sh - command: ['bundle', 'exec', 'sidekiq'] - restart: on-failure - environment: - RAILS_ENV: production - REDIS_URL: redis://dawarich_redis:6379/0 - DATABASE_HOST: dawarich_db - DATABASE_PORT: 5432 - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: {{ dawarich_db_password }} - DATABASE_NAME: dawarich_production - APPLICATION_HOSTS: loclog.thesatelliteoflove.com,localhost,::1,127.0.0.1 - BACKGROUND_PROCESSING_CONCURRENCY: 10 - APPLICATION_PROTOCOL: http - DISTANCE_UNIT: mi - PROMETHEUS_EXPORTER_ENABLED: false - PROMETHEUS_EXPORTER_HOST: dawarich_app - PROMETHEUS_EXPORTER_PORT: 9394 - SECRET_KEY_BASE: 1234567890 - RAILS_LOG_TO_STDOUT: "true" - logging: - driver: "json-file" - options: - max-size: "100m" - max-file: "5" - healthcheck: - test: [ "CMD-SHELL", "bundle exec sidekiqmon processes | grep $${HOSTNAME}" ] - interval: 10s - retries: 30 - start_period: 30s - timeout: 10s - depends_on: - dawarich_db: - condition: service_healthy - restart: true - dawarich_redis: - condition: service_healthy - restart: true - dawarich_app: - condition: service_healthy - restart: true - deploy: - resources: - limits: - cpus: '0.50' # Limit CPU usage to 50% of one core - memory: '2G' # Limit memory usage to 2GB - volumes: dawarich_db_data: - dawarich_redis_data: dawarich_public: dawarich_watched: + dawarich_storage: networks: default: external: true