The personal finance app for everyone (by everyone)
Ruby
Add backup service to Docker Compose configuration (#637)
Daniel Anomfueme278b2d00082e
diff --git a/compose.example.ai.yml b/compose.example.ai.ymlindex d62d040311..0230b8166b 100644--- a/compose.example.ai.yml+++ b/compose.example.ai.yml@@ -42,16 +42,18 @@ x-rails-env: &rails_envDB_PORT: 5432REDIS_URL: redis://redis:6379/1AI_DEBUG_MODE: "true" # Useful for debugging, set to "false" in production-# Ollama using OpenAI API compatible endpoints+ # Ollama using OpenAI API compatible endpointsOPENAI_ACCESS_TOKEN: token-can-be-any-value-for-ollama- OPENAI_MODEL: llama3.1:8b # Note: Use tool-enabled model+ OPENAI_MODEL: llama3.1:8b # Note: Use tool-enabled modelOPENAI_URI_BASE: http://ollama:11434/v1-# NOTE: enabling OpenAI will incur costs when you use AI-related features in the app (chat, rules). Make sure you have set appropriate spend limits on your account before adding this.-# OPENAI_ACCESS_TOKEN: ${OPENAI_ACCESS_TOKEN}+ # NOTE: enabling OpenAI will incur costs when you use AI-related features in the app (chat, rules). Make sure you have set appropriate spend limits on your account before adding this.+ # OPENAI_ACCESS_TOKEN: ${OPENAI_ACCESS_TOKEN}services:# Note: You still have to download models manually using the ollama CLI or via Open WebUIollama:+ profiles:+ - aivolumes:- ollama:/root/.ollamacontainer_name: ollama@@ -75,6 +77,8 @@ services:# capabilities: [ gpu ]ollama-webui:+ profiles:+ - aiimage: ghcr.io/open-webui/open-webuicontainer_name: ollama-webuivolumes:@@ -98,7 +102,7 @@ services:- sure_netweb:- image: ghcr.io/we-promise/sure:latest+ image: ghcr.io/we-promise/sure:stablevolumes:- app-storage:/rails/storageports:@@ -115,7 +119,7 @@ services:- sure_networker:- image: ghcr.io/we-promise/sure:latest+ image: ghcr.io/we-promise/sure:stablecommand: bundle exec sidekiqvolumes:- app-storage:/rails/storage@@ -145,6 +149,27 @@ services:networks:- sure_net+ backup:+ profiles:+ - backup+ image: prodrigestivill/postgres-backup-local+ restart: unless-stopped+ volumes:+ - /opt/sure-data/backups:/backups # Change this path to your desired backup location on the host machine+ environment:+ - POSTGRES_HOST=db+ - POSTGRES_DB=${POSTGRES_DB:-sure_production}+ - POSTGRES_USER=${POSTGRES_USER:-sure_user}+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-sure_password}+ - SCHEDULE=@daily # Runs once a day at midnight+ - BACKUP_KEEP_DAYS=7 # Keeps the last 7 days of backups+ - BACKUP_KEEP_WEEKS=4 # Keeps 4 weekly backups+ - BACKUP_KEEP_MONTHS=6 # Keeps 6 monthly backups+ depends_on:+ - db+ networks:+ - sure_net+redis:image: redis:latestrestart: unless-stoppeddiff --git a/compose.example.yml b/compose.example.ymlindex 01a97368b0..f8c33e9adf 100644--- a/compose.example.yml+++ b/compose.example.yml@@ -41,12 +41,12 @@ x-rails-env: &rails_envDB_HOST: dbDB_PORT: 5432REDIS_URL: redis://redis:6379/1-# NOTE: enabling OpenAI will incur costs when you use AI-related features in the app (chat, rules). Make sure you have set appropriate spend limits on your account before adding this.+ # NOTE: enabling OpenAI will incur costs when you use AI-related features in the app (chat, rules). Make sure you have set appropriate spend limits on your account before adding this.OPENAI_ACCESS_TOKEN: ${OPENAI_ACCESS_TOKEN}services:web:- image: ghcr.io/we-promise/sure:latest+ image: ghcr.io/we-promise/sure:stablevolumes:- app-storage:/rails/storageports:@@ -63,7 +63,7 @@ services:- sure_networker:- image: ghcr.io/we-promise/sure:latest+ image: ghcr.io/we-promise/sure:stablecommand: bundle exec sidekiqvolumes:- app-storage:/rails/storage@@ -93,6 +93,27 @@ services:networks:- sure_net+ backup:+ profiles:+ - backup+ image: prodrigestivill/postgres-backup-local+ restart: unless-stopped+ volumes:+ - /opt/sure-data/backups:/backups # Change this path to your desired backup location on the host machine+ environment:+ - POSTGRES_HOST=db+ - POSTGRES_DB=${POSTGRES_DB:-sure_production}+ - POSTGRES_USER=${POSTGRES_USER:-sure_user}+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-sure_password}+ - SCHEDULE=@daily # Runs once a day at midnight+ - BACKUP_KEEP_DAYS=7 # Keeps the last 7 days of backups+ - BACKUP_KEEP_WEEKS=4 # Keeps 4 weekly backups+ - BACKUP_KEEP_MONTHS=6 # Keeps 6 monthly backups+ depends_on:+ - db+ networks:+ - sure_net+redis:image: redis:latestrestart: unless-stopped