Files
HomeServerPortainerTemplates/stacks/dawarich-stack.yaml

167 lines
4.7 KiB
YAML

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
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
- type: bind
source: /srv/dawarich/db_data
target: /dawarich_db_data
networks:
- dawarich
ports:
- ${DAWARICH_PORT}:3000
# - 9394:9394 # Prometheus exporter, uncomment if needed
stdin_open: true
tty: true
entrypoint: web-entrypoint.sh
command: ['bin/rails', 'server', '-p', '3000', '-b', '::']
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}
MIN_MINUTES_SPENT_IN_CITY: 60
#Default localhost,::1,127.0.0.1,<DockerHostIP>,<DDNS Domain>
APPLICATION_HOSTS: ${APPLICATION_HOSTS}
TIME_ZONE: Europe/Amsterdam
APPLICATION_PROTOCOL: http
STORE_GEODATA: "true"
PROMETHEUS_EXPORTER_ENABLED: false
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
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", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ]
interval: 10s
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:
dawarich_storage:
dawarich_db_data: