diff --git a/stacks/dawarich-stack.yaml b/stacks/dawarich-stack.yaml index 0212327..a2357dd 100644 --- a/stacks/dawarich-stack.yaml +++ b/stacks/dawarich-stack.yaml @@ -3,6 +3,23 @@ version: '3' networks: dawarich: services: + dawarich_valkey: + image: valkey/valkey + container_name: dawarich_valkey + command: valkey-server + networks: + - dawarich + volumes: + - type: bind + source: /srv/dawarich/valkey + target: /data + restart: always + healthcheck: + test: [ "CMD", "valkey-cli", "--raw", "incr", "ping" ] + interval: 10s + retries: 5 + start_period: 30s + timeout: 10s dawarich_app: image: freikin/dawarich:latest container_name: dawarich_app @@ -32,6 +49,7 @@ services: environment: #RAILS_ENV: production RAILS_ENV: development + REDIS_URL: redis://dawarich_valkey:6379/0 DATABASE_HOST: ${POSTGRESS_HOST} # Default 5432 DATABASE_PORT: ${POSTGRESS_PORT} @@ -53,9 +71,6 @@ services: PHOTON_API_HOST: ${PHOTON_API_HOST} PHOTON_API_KEY: ${PHOTON_API_KEY} SELF_HOSTED: "true" - QUEUE_DATABASE_PATH: /dawarich_db_data/dawarich_development_queue.sqlite3 - CACHE_DATABASE_PATH: /dawarich_db_data/dawarich_development_cache.sqlite3 - CABLE_DATABASE_PATH: /dawarich_db_data/dawarich_development_cable.sqlite3 logging: driver: "json-file" options: @@ -67,12 +82,83 @@ services: retries: 30 start_period: 30s timeout: 10s + depends_on: + dawarich_valkey: + condition: service_healthy + restart: true deploy: resources: limits: cpus: '1' # Limit CPU usage to 50% of one core memory: '4G' # Limit memory usage to 2GB - + + dawarich_sidekiq: + image: freikin/dawarich:latest + container_name: dawarich_sidekiq + volumes: + - type: bind + source: /srv/dawarich/watched + target: /var/app/tmp/imports/watched + - type: bind + source: /srv/dawarich/public + target: /var/app/public + - type: bind + source: /srv/dawarich/storage + target: /var/app/storage + networks: + - dawarich + stdin_open: true + tty: true + entrypoint: sidekiq-entrypoint.sh + command: ['sidekiq'] + restart: on-failure + environment: + #RAILS_ENV: production + RAILS_ENV: development + REDIS_URL: redis://dawarich_valkey:6379/0 + DATABASE_HOST: ${POSTGRESS_HOST} + # Default 5432 + DATABASE_PORT: ${POSTGRESS_PORT} + DATABASE_USERNAME: ${POSTGRESS_DB_USERNAME} + DATABASE_PASSWORD: ${POSTGRESS_DB_PASSWORD} + DATABASE_NAME: ${POSTGRESS_DB_NAME} + APPLICATION_HOSTS: localhost,::1,127.0.0.1 + BACKGROUND_PROCESSING_CONCURRENCY: 10 + APPLICATION_PROTOCOL: http + STORE_GEODATA: "true" + PROMETHEUS_EXPORTER_ENABLED: false + PROMETHEUS_EXPORTER_HOST: dawarich_app + PROMETHEUS_EXPORTER_PORT: 9394 + SECRET_KEY_BASE: ${SECRET_KEY_BASE} + RAILS_LOG_TO_STDOUT: "true" + PHOTON_API_USE_HTTPS: "true" + PHOTON_API_HOST: ${PHOTON_API_HOST} + PHOTON_API_KEY: ${PHOTON_API_KEY} + SELF_HOSTED: "true" + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "5" + healthcheck: + test: [ "CMD-SHELL", "pgrep -f sidekiq" ] + interval: 10s + retries: 30 + start_period: 30s + timeout: 10s + depends_on: + dawarich_valkey: + condition: service_healthy + restart: true + dawarich_app: + condition: service_healthy + restart: true + deploy: + resources: + limits: + cpus: '1' # Limit CPU usage to 50% of one core + memory: '4G' # Limit memory usage to 2GB + volumes: dawarich_public: dawarich_watched: