diff --git a/projects/finder-frontend/docker-compose.yml b/projects/finder-frontend/docker-compose.yml index 7115cb9a..8af2111f 100644 --- a/projects/finder-frontend/docker-compose.yml +++ b/projects/finder-frontend/docker-compose.yml @@ -48,6 +48,15 @@ services: - "3000" command: bin/rails s --restart + finder-frontend-search-v2: &finder-frontend-search-v2 + <<: *finder-frontend-app + environment: + PLEK_SERVICE_SEARCH_API_URI: http://search-api-v2-app:3000 + GOVUK_PROXY_STATIC_ENABLED: "true" + VIRTUAL_HOST: finder-frontend.dev.gov.uk + BINDING: 0.0.0.0 + MEMCACHE_SERVERS: memcached + finder-frontend-app-live: <<: *finder-frontend-app depends_on: diff --git a/projects/search-api-v2/Makefile b/projects/search-api-v2/Makefile index 9a5fb648..7a279fa8 100644 --- a/projects/search-api-v2/Makefile +++ b/projects/search-api-v2/Makefile @@ -17,6 +17,13 @@ define SEARCH_API_V2_WARN_DATASTORE otherwise the app will not be able to access Discovery Engine. See the README for details.\033[0m endef +define SEARCH_API_V2_WARN_SERVING_CONFIG +\033[1;31mWarning: DISCOVERY_ENGINE_SERVING_CONFIG environment variable is not set.\ +\n\033[0;31mYou need to set this environment variable locally before running govuk-docker up,\ +otherwise the app will not be able to access Discovery Engine. See the README for details.\033[0m +endef + prerequisites-search-api-v2: @command -v gcloud >/dev/null 2>&1 || { echo "$(SEARCH_API_V2_WARN_GCLOUD)"; } @[ -n "$${DISCOVERY_ENGINE_DATASTORE}" ] || { echo "$(SEARCH_API_V2_WARN_DATASTORE)"; } + @[ -n "$${DISCOVERY_ENGINE_SERVING_CONFIG}" ] || { echo "$(SEARCH_API_V2_WARN_SERVING_CONFIG)"; } diff --git a/projects/search-api-v2/docker-compose.yml b/projects/search-api-v2/docker-compose.yml index 74252e83..6df1c954 100644 --- a/projects/search-api-v2/docker-compose.yml +++ b/projects/search-api-v2/docker-compose.yml @@ -35,14 +35,19 @@ services: environment: RABBITMQ_URL: "amqp://guest:guest@rabbitmq" PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME: "search_api_v2_published_documents" - RAILS_DEVELOPMENT_HOSTS: "search-api-v2.dev.gov.uk" + RAILS_DEVELOPMENT_HOSTS: "search-api-v2.dev.gov.uk,search-api-v2-app" VIRTUAL_HOST: "search-api-v2.dev.gov.uk" BINDING: "0.0.0.0" - # The fully qualified ID of the datastore on Discovery Engine (required to use Discovery - # Engine locally, can be set on `govuk-docker up` invocation or permanently in your local - # environment) - # e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/local-my-name" + # The fully qualified ID of the datastore and engine on the Discovery Engine dev environment + # (required to use Discovery Engine locally, can be set on `govuk-docker up` invocation or + # permanently in your local environment). + # + # e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/ + # local-my-name" DISCOVERY_ENGINE_DATASTORE: "${DISCOVERY_ENGINE_DATASTORE}" + # e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/ + # local-my-name/servingConfigs/default_serving_config" + DISCOVERY_ENGINE_SERVING_CONFIG: "${DISCOVERY_ENGINE_SERVING_CONFIG}" expose: - "3000" command: bin/rails server --restart @@ -54,9 +59,14 @@ services: environment: RABBITMQ_URL: "amqp://guest:guest@rabbitmq" PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME: "search_api_v2_published_documents" - # The fully qualified ID of the datastore on Discovery Engine (required to use Discovery - # Engine locally, can be set on `govuk-docker up` invocation or permanently in your local - # environment) - # e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/local-my-name" + # The fully qualified ID of the datastore and serving config on the Discovery Engine dev + # environment (required to use Discovery Engine locally, can be set on `govuk-docker up` + # invocation or permanently in your local environment). + # + # e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/ + # local-my-name" DISCOVERY_ENGINE_DATASTORE: "${DISCOVERY_ENGINE_DATASTORE}" + # e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/ + # local-my-name/servingConfigs/default_serving_config" + DISCOVERY_ENGINE_SERVING_CONFIG: "${DISCOVERY_ENGINE_SERVING_CONFIG}" command: bin/rake document_sync_worker:run