Skip to content

Commit

Permalink
Add Opensearch 2 as a dependency of GOV.UK Chat
Browse files Browse the repository at this point in the history
GOV.UK Chat will be using this as a search index, this includes the
running of a rake task to create the search index in the make task for
the project.
  • Loading branch information
kevindew committed Apr 4, 2024
1 parent 801708b commit f3369f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ volumes:
go:
elasticsearch-6:
elasticsearch-7:
opensearch-2:

networks:
default:
Expand Down Expand Up @@ -106,6 +107,16 @@ services:
volumes:
- elasticsearch-7:/usr/share/elasticsearch/data

opensearch-2:
image: opensearchproject/opensearch:2
environment:
- discovery.type=single-node
- "OPENSEARCH_JAVA_OPTS=-Xms2g -Xmx2g"
- "DISABLE_INSTALL_DEMO_CONFIG=true" # Prevents execution of bundled demo script which installs demo certificates and security configurations to OpenSearch
- "DISABLE_SECURITY_PLUGIN=true"
volumes:
- opensearch-2:/usr/share/opensearch/data

nginx-proxy:
image: jwilder/nginx-proxy:latest
ports:
Expand Down
1 change: 1 addition & 0 deletions projects/govuk-chat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ govuk-chat: bundle-govuk-chat
$(GOVUK_DOCKER) run $@-lite env RAILS_ENV=test bin/rails db:prepare
$(GOVUK_DOCKER) run $@-lite yarn
$(GOVUK_DOCKER) run $@-lite bundle exec rake message_queue:create_published_documents_queue
$(GOVUK_DOCKER) run $@-lite bundle exec rake search:create_chunked_content_index
4 changes: 4 additions & 0 deletions projects/govuk-chat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ services:
govuk-chat-lite:
<<: *govuk-chat
depends_on:
- opensearch-2
- postgres-13
- rabbitmq
environment:
DATABASE_URL: "postgresql://postgres@postgres-13/govuk-chat"
TEST_DATABASE_URL: "postgresql://postgres@postgres-13/govuk-chat-test"
RABBITMQ_URL: amqp://guest:guest@rabbitmq
OPENSEARCH_URL: http://opensearch-2:9200

govuk-chat-app:
<<: *govuk-chat
Expand Down Expand Up @@ -63,7 +65,9 @@ services:
govuk-chat-queue-consumer:
<<: *govuk-chat
depends_on:
- opensearch-2
- rabbitmq
environment:
RABBITMQ_URL: amqp://guest:guest@rabbitmq
OPENSEARCH_URL: http://opensearch-2:9200
command: bin/dev queue_consumer

0 comments on commit f3369f7

Please sign in to comment.