Skip to content

Commit

Permalink
Merge pull request #796 from alphagov/separate-redis-instances
Browse files Browse the repository at this point in the history
Use a separate redis instance for each project
  • Loading branch information
ryanb-gds authored Nov 18, 2024
2 parents 911de0b + 88d9a4e commit d0dfb16
Show file tree
Hide file tree
Showing 32 changed files with 250 additions and 153 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ services:
ES_JAVA_OPTS: -Xms1g -Xmx1g
volumes:
- elasticsearch-6:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"

elasticsearch-7:
image: elasticsearch:7.9.3
Expand Down
15 changes: 9 additions & 6 deletions projects/account-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ services:
#
# https://trello.com/c/ZMFOPaCl/1176-upgrade-our-app-databases
- postgres-13
- redis
- account-api-redis
environment:
MEMCACHE_SERVERS: memcached
DATABASE_URL: "postgresql://postgres@postgres-13/account-api"
TEST_DATABASE_URL: "postgresql://postgres@postgres-13/account-api-test"
REDIS_URL: redis://redis
REDIS_URL: redis://account-api-redis

account-api-app:
<<: *account-api
Expand All @@ -38,15 +38,15 @@ services:
- memcached
- nginx-proxy
- postgres-13
- redis
- account-api-redis
environment:
MEMCACHE_SERVERS: memcached
DATABASE_URL: "postgresql://postgres@postgres-13/account-api"
VIRTUAL_HOST: account-api.dev.gov.uk
BINDING: 0.0.0.0
GOVUK_ACCOUNT_OAUTH_CLIENT_ID: client-id
GOVUK_ACCOUNT_OAUTH_CLIENT_SECRET: client-secret
REDIS_URL: redis://redis
REDIS_URL: redis://account-api-redis
expose:
- "3000"
command: bin/rails s --restart
Expand All @@ -57,11 +57,11 @@ services:
- memcached
- nginx-proxy
- postgres-13
- redis
- account-api-redis
environment:
BINDING: 0.0.0.0
DATABASE_URL: "postgresql://postgres@postgres-13/account-api"
REDIS_URL: redis://redis
REDIS_URL: redis://account-api-redis
GOVUK_ACCOUNT_OAUTH_CLIENT_ID: client-id
GOVUK_ACCOUNT_OAUTH_CLIENT_SECRET: client-secret
GOVUK_WEBSITE_ROOT: https://www.gov.uk
Expand All @@ -72,3 +72,6 @@ services:
expose:
- "3000"
command: bin/rails s --restart

account-api-redis:
image: redis
15 changes: 9 additions & 6 deletions projects/asset-manager/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ services:
<<: *asset-manager
depends_on:
- mongo-3.6
- redis
- asset-manager-redis
environment:
MONGODB_URI: "mongodb://mongo-3.6/asset-manager"
FAKE_S3_HOST: "http://asset-manager.dev.gov.uk"
TEST_MONGODB_URI: "mongodb://mongo-3.6/asset-manager-test"
REDIS_URL: redis://redis
REDIS_URL: redis://asset-manager-redis

asset-manager-app: &asset-manager-app
<<: *asset-manager
depends_on:
- mongo-3.6
- redis
- asset-manager-redis
- nginx-proxy
- asset-manager-worker
environment:
MONGODB_URI: "mongodb://mongo-3.6/asset-manager"
FAKE_S3_HOST: "http://asset-manager.dev.gov.uk"
REDIS_URL: redis://redis
REDIS_URL: redis://asset-manager-redis
VIRTUAL_HOST: asset-manager.dev.gov.uk
BINDING: 0.0.0.0
expose:
Expand All @@ -50,11 +50,14 @@ services:
<<: *asset-manager
depends_on:
- mongo-3.6
- redis
- asset-manager-redis
environment:
MONGODB_URI: "mongodb://mongo-3.6/asset-manager"
REDIS_URL: redis://redis
REDIS_URL: redis://asset-manager-redis
ASSET_MANAGER_CLAMSCAN_PATH: /bin/true
FAKE_S3_HOST: "http://asset-manager.dev.gov.uk"
ALLOW_FAKE_S3_IN_PRODUCTION_FOR_PUBLISHING_E2E_TESTS: "true"
command: bundle exec sidekiq -C ./config/sidekiq.yml

asset-manager-redis:
image: redis
15 changes: 9 additions & 6 deletions projects/collections-publisher/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ services:
shm_size: 512mb
depends_on:
- mysql-8
- redis
- collections-publisher-redis
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/collections_publisher_development"
TEST_DATABASE_URL: "mysql2://root:root@mysql-8/collections_publisher_test"
REDIS_URL: redis://redis
REDIS_URL: redis://collections-publisher-redis
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: "true"

collections-publisher-app: &collections-publisher-app
<<: *collections-publisher
depends_on:
- mysql-8
- redis
- collections-publisher-redis
- content-store-app
- link-checker-api-app
- nginx-proxy
- publishing-api-app
- collections-publisher-worker
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/collections_publisher_development"
REDIS_URL: redis://redis
REDIS_URL: redis://collections-publisher-redis
VIRTUAL_HOST: collections-publisher.dev.gov.uk
BINDING: 0.0.0.0
expose:
Expand All @@ -51,10 +51,13 @@ services:
collections-publisher-worker:
<<: *collections-publisher
depends_on:
- redis
- collections-publisher-redis
- mysql-8
- publishing-api-app
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/collections_publisher_development"
REDIS_URL: redis://redis
REDIS_URL: redis://collections-publisher-redis
command: bundle exec sidekiq -C ./config/sidekiq.yml

collections-publisher-redis:
image: redis
11 changes: 7 additions & 4 deletions projects/contacts-admin/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,30 @@ services:
shm_size: 512mb
depends_on:
- mysql-8
- redis
- contacts-admin-redis
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/contacts_development"
TEST_DATABASE_URL: "mysql2://root:root@mysql-8/contacts_test"
REDIS_URL: redis://redis
REDIS_URL: redis://contacts-admin-redis

contacts-admin-app: &contacts-admin-app
<<: *contacts-admin
depends_on:
- mysql-8
- redis
- contacts-admin-redis
- publishing-api-app
- nginx-proxy
- content-store-app
- whitehall-app
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/contacts_development"
TEST_DATABASE_URL: "mysql2://root:root@mysql-8/contacts_test"
REDIS_URL: redis://redis
REDIS_URL: redis://contacts-admin-redis
VIRTUAL_HOST: contacts-admin.dev.gov.uk
BINDING: 0.0.0.0
expose:
- "3000"
command: bin/rails s --restart

contacts-admin-redis:
image: redis
15 changes: 9 additions & 6 deletions projects/content-publisher/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ services:
shm_size: 512mb
depends_on:
- postgres-13
- redis
- content-publisher-redis
environment:
DATABASE_URL: "postgresql://postgres@postgres-13/content-publisher"
TEST_DATABASE_URL: "postgresql://postgres@postgres-13/content-publisher-test"
REDIS_URL: redis://redis
REDIS_URL: redis://content-publisher-redis

content-publisher-app: &content-publisher-app
<<: *content-publisher
depends_on:
- postgres-13
- redis
- content-publisher-redis
- content-publisher-worker
- publishing-api-app
- asset-manager-app
- nginx-proxy
- content-store-app
environment:
DATABASE_URL: "postgresql://postgres@postgres-13/content-publisher"
REDIS_URL: redis://redis
REDIS_URL: redis://content-publisher-redis
VIRTUAL_HOST: content-publisher.dev.gov.uk
BINDING: 0.0.0.0
expose:
Expand All @@ -54,10 +54,13 @@ services:
<<: *content-publisher
depends_on:
- postgres-13
- redis
- content-publisher-redis
- publishing-api-app
- asset-manager-app
environment:
DATABASE_URL: "postgresql://postgres@postgres-13/content-publisher"
REDIS_URL: redis://redis
REDIS_URL: redis://content-publisher-redis
command: bundle exec sidekiq -C ./config/sidekiq.yml

content-publisher-redis:
image: redis
7 changes: 5 additions & 2 deletions projects/content-tagger/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ services:
- postgres-13
- publishing-api-app
- nginx-proxy
- redis
- content-tagger-redis
environment:
DATABASE_URL: "postgresql://postgres@postgres-13/content-tagger"
VIRTUAL_HOST: content-tagger.dev.gov.uk
REDIS_URL: redis://redis
REDIS_URL: redis://content-tagger-redis
BINDING: 0.0.0.0
expose:
- "3000"
command: bin/dev

content-tagger-redis:
image: redis
15 changes: 9 additions & 6 deletions projects/email-alert-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ services:
<<: *email-alert-api
depends_on:
- postgres-13-email-alert-api
- redis
- email-alert-api-redis
environment:
DATABASE_URL: "postgresql://email-alert-api@postgres-13-email-alert-api/email-alert-api"
TEST_DATABASE_URL: "postgresql://email-alert-api@postgres-13-email-alert-api/email-alert-api-test"
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-api-redis

email-alert-api-app: &email-alert-api-app
<<: *email-alert-api
depends_on:
- nginx-proxy
- postgres-13-email-alert-api
- redis
- email-alert-api-redis
environment:
DATABASE_URL: "postgresql://email-alert-api@postgres-13-email-alert-api/email-alert-api"
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-api-redis
VIRTUAL_HOST: email-alert-api.dev.gov.uk
BINDING: 0.0.0.0
expose:
Expand All @@ -44,8 +44,11 @@ services:
<<: *email-alert-api
depends_on:
- postgres-13-email-alert-api
- redis
- email-alert-api-redis
environment:
DATABASE_URL: "postgresql://email-alert-api@postgres-13-email-alert-api/email-alert-api"
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-api-redis
command: bundle exec sidekiq -C ./config/sidekiq.yml

email-alert-api-redis:
image: redis
15 changes: 9 additions & 6 deletions projects/email-alert-frontend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ services:
email-alert-frontend-lite:
<<: *email-alert-frontend
depends_on:
- redis
- email-alert-frontend-redis
environment:
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-frontend-redis

email-alert-frontend-app: &email-alert-frontend-app
<<: *email-alert-frontend
depends_on:
- redis
- email-alert-frontend-redis
- router-app
- content-store-app
- static-app
- email-alert-api-app
- nginx-proxy
environment:
GOVUK_PROXY_STATIC_ENABLED: "true"
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-frontend-redis
VIRTUAL_HOST: email-alert-frontend.dev.gov.uk
BINDING: 0.0.0.0
expose:
Expand All @@ -45,14 +45,17 @@ services:
email-alert-frontend-app-live:
<<: *email-alert-frontend-app
depends_on:
- redis
- email-alert-frontend-redis
- email-alert-api-app
- nginx-proxy
environment:
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-frontend-redis
GOVUK_WEBSITE_ROOT: https://www.gov.uk
GOVUK_PROXY_STATIC_ENABLED: "true"
PLEK_SERVICE_CONTENT_STORE_URI: https://www.gov.uk/api
PLEK_SERVICE_STATIC_URI: https://assets.publishing.service.gov.uk
VIRTUAL_HOST: email-alert-frontend.dev.gov.uk
BINDING: 0.0.0.0

email-alert-frontend-redis:
image: redis
7 changes: 5 additions & 2 deletions projects/email-alert-service/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ services:
email-alert-service-lite:
<<: *email-alert-service
depends_on:
- redis
- email-alert-service-redis
environment:
REDIS_URL: redis://redis
REDIS_URL: redis://email-alert-service-redis

email-alert-service-redis:
image: redis
11 changes: 7 additions & 4 deletions projects/feedback/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ services:
feedback-app: &feedback-app
<<: *feedback
depends_on:
- redis
- feedback-redis
- router-app
- static-app
- nginx-proxy
- support-api-app
- support-app
environment:
GOVUK_PROXY_STATIC_ENABLED: "true"
REDIS_URL: redis://redis
REDIS_URL: redis://feedback-redis
VIRTUAL_HOST: feedback.dev.gov.uk
BINDING: 0.0.0.0
expose:
Expand All @@ -42,7 +42,7 @@ services:
feedback-app-live:
<<: *feedback-app
depends_on:
- redis
- feedback-redis
- nginx-proxy
environment:
GOVUK_WEBSITE_ROOT: https://www.gov.uk
Expand All @@ -51,4 +51,7 @@ services:
PLEK_SERVICE_STATIC_URI: https://assets.publishing.service.gov.uk
VIRTUAL_HOST: feedback.dev.gov.uk
BINDING: 0.0.0.0
REDIS_URL: redis://redis
REDIS_URL: redis://feedback-redis

feedback-redis:
image: redis
Loading

0 comments on commit d0dfb16

Please sign in to comment.