fix: complete Dawarich architecture with Redis and Sidekiq services
- Add Redis service for caching and background job processing - Add Sidekiq worker service for background tasks - Update to tagged version 0.28.1 for stability - Fix Redis URL format to resolve parsing errors - Remove incorrect volume mounts and SQLite paths - Add proper service dependencies and health checks - Use vault variable for SECRET_KEY_BASE security 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -1,4 +1,19 @@
|
|||||||
services:
|
services:
|
||||||
|
dawarich_redis:
|
||||||
|
image: redis:7.4-alpine
|
||||||
|
container_name: dawarich_redis
|
||||||
|
labels:
|
||||||
|
glance.parent: dawarich
|
||||||
|
glance.name: Redis
|
||||||
|
volumes:
|
||||||
|
- dawarich_redis_data:/data
|
||||||
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
timeout: 10s
|
||||||
dawarich_db:
|
dawarich_db:
|
||||||
image: postgis/postgis:17-3.5-alpine
|
image: postgis/postgis:17-3.5-alpine
|
||||||
shm_size: 1G
|
shm_size: 1G
|
||||||
@ -19,8 +34,9 @@ services:
|
|||||||
retries: 5
|
retries: 5
|
||||||
start_period: 30s
|
start_period: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
|
|
||||||
dawarich_app:
|
dawarich_app:
|
||||||
image: freikin/dawarich:latest
|
image: freikin/dawarich:0.28.1
|
||||||
container_name: dawarich_app
|
container_name: dawarich_app
|
||||||
labels:
|
labels:
|
||||||
glance.name: Dawarich
|
glance.name: Dawarich
|
||||||
@ -32,7 +48,6 @@ services:
|
|||||||
- dawarich_public:/var/app/public
|
- dawarich_public:/var/app/public
|
||||||
- dawarich_watched:/var/app/tmp/imports/watched
|
- dawarich_watched:/var/app/tmp/imports/watched
|
||||||
- dawarich_storage:/var/app/storage
|
- dawarich_storage:/var/app/storage
|
||||||
- dawarich_db_data:/dawarich_db_data
|
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
entrypoint: web-entrypoint.sh
|
entrypoint: web-entrypoint.sh
|
||||||
@ -40,13 +55,12 @@ services:
|
|||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
RAILS_ENV: production
|
RAILS_ENV: production
|
||||||
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_HOST: dawarich_db
|
||||||
DATABASE_PORT: 5432
|
DATABASE_PORT: 5432
|
||||||
DATABASE_USERNAME: postgres
|
DATABASE_USERNAME: postgres
|
||||||
DATABASE_PASSWORD: {{ vault_dawarich.postgres_password }}
|
DATABASE_PASSWORD: {{ vault_dawarich.postgres_password }}
|
||||||
DATABASE_NAME: dawarich_production
|
DATABASE_NAME: dawarich_production
|
||||||
|
REDIS_URL: redis://dawarich_redis:6379
|
||||||
MIN_MINUTES_SPENT_IN_CITY: 60
|
MIN_MINUTES_SPENT_IN_CITY: 60
|
||||||
APPLICATION_HOSTS: {{ subdomains.loclog }},localhost,::1,127.0.0.1
|
APPLICATION_HOSTS: {{ subdomains.loclog }},localhost,::1,127.0.0.1
|
||||||
TIME_ZONE: America/Denver
|
TIME_ZONE: America/Denver
|
||||||
@ -55,7 +69,7 @@ services:
|
|||||||
PROMETHEUS_EXPORTER_ENABLED: false
|
PROMETHEUS_EXPORTER_ENABLED: false
|
||||||
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
|
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
|
||||||
PROMETHEUS_EXPORTER_PORT: 9394
|
PROMETHEUS_EXPORTER_PORT: 9394
|
||||||
SECRET_KEY_BASE: 1234567890
|
SECRET_KEY_BASE: {{ vault_dawarich.secret_key_base }}
|
||||||
RAILS_LOG_TO_STDOUT: "true"
|
RAILS_LOG_TO_STDOUT: "true"
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
@ -72,13 +86,69 @@ services:
|
|||||||
dawarich_db:
|
dawarich_db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: true
|
restart: true
|
||||||
|
dawarich_redis:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: true
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: '0.50' # Limit CPU usage to 50% of one core
|
cpus: '0.50'
|
||||||
memory: '2G' # Limit memory usage to 2GB
|
memory: '2G'
|
||||||
|
dawarich_sidekiq:
|
||||||
|
image: freikin/dawarich:0.28.1
|
||||||
|
container_name: dawarich_sidekiq
|
||||||
|
labels:
|
||||||
|
glance.parent: dawarich
|
||||||
|
glance.name: 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: on-failure
|
||||||
|
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
|
||||||
|
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
|
||||||
volumes:
|
volumes:
|
||||||
dawarich_db_data:
|
dawarich_db_data:
|
||||||
|
dawarich_redis_data:
|
||||||
dawarich_public:
|
dawarich_public:
|
||||||
dawarich_watched:
|
dawarich_watched:
|
||||||
dawarich_storage:
|
dawarich_storage:
|
||||||
|
Reference in New Issue
Block a user