Skip to content

appbaseio/reactivesearch-api-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReactiveSearch.io: Dockerize Setup

This setup enables you to run ReactiveSearch API server with single command, i.e. docker-compose up -d 😎.

The docker-compose setup in this repository comes with four different services:

reactivesearch-api

reactivesearch-api is an opensource image providing a declarative API to query Elasticsearch, and is required by ReactiveSearch and Searchbox UI libraries. You can check out the source code over here.

It is also available as a licensed image.

Note: Make sure your rs-api container has super user access to Elasticsearch. You can secure Elasticsearch URL with Basic Auth or set an IP based restriction.

nginx

This service helps in setting up reverse proxy for Arc Service and serving Configuration service. It also helps in serving data using with TLS certificate, which is recommended for production.

elasticsearch

The Elasticsearch service allows spinning up an Elasticsearch server instance locally. This is optional, however running this service allows for an end-to-end ReactiveSearch service setup.

opensearch

The OpenSearch service allows spinning up an OpenSearch server instance locally. This is an alteroptional, however running this service allows for an end-to-end ReactiveSearch service setup.

file Use Case
docker-compose-oss-with-elasticsearch-without-nginx.yaml Run the open-source ReactiveSearch API server with Elasticsearch, but without Nginx and ReactiveSearch's config GUI.
docker-compose-oss-with-elasticsearch.yaml Run the open-source ReactiveSearch API server with Elasticsearch, Nginx and ReactiveSearch's config GUI.
docker-compose-oss.yaml Run the open-source ReactiveSearch API server with Nginx and ReactiveSearch's config GUI, but without Elasticsearch (i.e. it's assumed to be hosted in cloud).
docker-compose-with-elasticsearch-without-nginx.yaml Run the licensed ReactiveSearch API server with Elasticsearch, but without Nginx and ReactiveSearch's config GUI.
docker-compose-with-elasticsearch.yaml Run the licensed ReactiveSearch API server with Elasticsearch, Nginx and ReactiveSearch's config GUI.
docker-compose.yaml Run the licensed ReactiveSearch API server with Nginx and ReactiveSearch's config GUI, but without Elasticsearch (i.e. it's assumed to be hosted in cloud).
docker-compose-oss-with-opensearch.yaml Run the open-source ReactiveSearch API server with OpenSearch, and Nginx.
docker-compose-with-opensearch.yaml Run the open-source ReactiveSearch API server with OpenSearch, Nginx and ReactiveSearch's config GUI.

To run one of the above presets, use the following command:

docker-compose -f ${file} up -d

Similarly, docker-compose -f ${file} down will delete

where ${file} is one of the above values.

Quick Start 🚀

The steps described here assumes a docker installation on the system.

  • Step 1: Get APPBASE_ID following the steps mentioned here

Note: Skip this step when running in an open-source mode

  • Step 2: Clone the repository

    git clone https://github.com/appbaseio/reactivesearch-api-docker.git && cd reactivesearch-api-docker
  • Step 3: Configure logging system

    ReactiveSearch API uses Fluentbit to log the requests and provide analytics on top of that. In order to setup fluentbit, update fluent-bit.conf with Elasticsearch Host, Port, tls, HTTP_User and HTTP_Passwd information.

    Note: If you are using docker-compose-with-elasticsearch.yaml then you don't need to change any configurations in here.

  • Step 4: Build and run docker containers

    We highly recommend using ReactiveSearch API with TLS so that we can easily bind this with ReactiveSearch Dashboard. To simplify the process of docker build, test and deployment we have created 2 versions:

    1 - Install ReactiveSearch API + Nginx with TLS setup (Recommended for production)

    • Change TLS certificate and keys with production files. Please obtain TLS certificate and key for your domain using Let's Encrypt or any other provider. Update the files in nginx/certs
    • In case you are using different name then mentioned in nginx/certs folder, then please update them in docker-compose.yaml file as well

    Also, make sure you update file names in nginx/default.conf file

    docker-compose up -d

    2 - Install ReactiveSearch API + Elasticsearch (If you want to deploy ReactiveSearch API Along with Elasticsearch.)

    docker-compose -f docker-compose-with-elasticsearch.yaml up -d
    

    🔥 Thats all, our containers should be up and running. Next let us configure environment variables required by Arc service.

  • Step 5: Open configuration service URL in your browser, i.e. http://localhost

    Note: If you are running this setup on an virtual machine, make sure ports 80 and 443 are set in your inbound rules for the cluster.

  • Step 6: Set credentials

  • Step 7: Configure Elasticsearch URL and APPBASE_ID obtained above.

    Note: Once you save the configuration, it may take 5-10s to restart the reactivesearch-api service.

  • Step 8: Start using ReactiveSearch API using ReactiveSearch Dashboard. Here you will have to input Arc Cluster URL which will be http://localhost and credentials would be the one that you configured initially on Step 5.

Configuring TLS for development

We recommend configuring TLS using the excellent mkcert utility. Once installed on your local system:

mkcert -key-file=nginx/certs/server.key -cert-file=nginx/certs/server.crt reactivesearch.dev localhost

This will save the cert key and pem files into paths that are used by the nginx service in the docker-compose-with-elasticsearch.yaml file.

Once the certs are configured, start the service with:

docker-compose -f docker-compose-with-elasticsearch.yaml up -d

You can now visit: https://localhost to get a TLS domain. For https://reactivesearch.dev to point to reactivesearch.io service, add the entry:

127.0.0.1    reactivesearch.dev

in your /etc/hosts file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages