Skip to content

Commit

Permalink
use MEMCACHE_SERVER env variable with fallback to localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
alexskr committed Dec 3, 2024
1 parent 0942763 commit 1534aec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
config.assets.quiet = true

# memcache setup
config.cache_store = ActiveSupport::Cache::MemCacheStore.new('localhost', namespace: 'BioPortal')
config.cache_store = :mem_cache_store, ENV['MEMCACHE_SERVERS'] || 'localhost', { namespace: 'BioPortal' }

# Silence cache output
config.cache_store.logger = Logger.new("/dev/null") if config.cache_store.respond_to?(:logger)
Expand All @@ -93,4 +93,4 @@

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end
end
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.cache_store = ActiveSupport::Cache::MemCacheStore.new('localhost:11211', namespace: 'BioPortal')
config.cache_store = :mem_cache_store, ENV['MEMCACHE_SERVERS'] || 'localhost', { namespace: 'BioPortal' }

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ x-app: &default-app
BUNDLE_WITHOUT: ""
BUNDLE_PATH: /usr/local/bundle
DB_HOST: db
CACHE_HOST: cache
MEMCACHE_SERVERS: "cache:11211"
tmpfs:
- /tmp
- /app/tmp/pids
Expand Down

0 comments on commit 1534aec

Please sign in to comment.