Bootstrap app for Nodejs Elasticsearch apps
This application is just a simple demo what can be used as a basis for new applications.
It provides the basic indexing commands indexing, listing and detail pages,
It can be cloned, and with minimal configuration a new search application
created from it.
Basic usage of the image is given by the following pattern:
docker run -d -v /path/of/your/config/:/code/config:z -p 8080:3000 -e "elastic_host=<elasticsearch_host_or_ip>" eeacms/esbootstrap:v1.0
<elasticsearch_host_or_ip>is the url or the ip of your elastic search server without the port
./configis the folder that contains the configuration files for your app. Read this to know how to configure.
Read this to know how to setup.
For creating a new application you have to follow the next steps:
1. Clone eea.docker.searchservices on the development machine
$ git clone --recursive https://github.com/eea/eea.docker.searchservices.git
2. Clone the eea.docker.esbootstrap
$ cd eea.docker.searchservices $ # clone eea.docker.esbootstrap under eea.docker.searchservices and gives new name: eea.docker.newesapp $ git clone https://github.com/eea/eea.docker.esbootstrap.git eea.docker.newesapp
3. Configure the new app
The config folder contains the configuration files for your app. Read this to know how to configure the files for your app.
4. Configure the eea.docker.searchservices to include the new application
4.1. Add it in the docker-compose.dev.yml file
Clone the docker-compose.dev.yml.example file under the name docker-compose.dev.yml and add to it the settings for development
image: eeacms/esbootstrap:dev # Work with dev build
- 3030:3000 # Take up an empty port number
- AUTO_INDEXING=true #index data when the app is started for the first time
# - SYNC_CRONTAB=/30 * # This is optional, it executes the sync with a cronjob every 30 minutes
- ./eea.docker.newesapp/app/:/code/:z # the volumes are added for easier development
4.2. Testing the application
At first try you have to build all development images for the applications
Later, when you modify your application, is enough to rebuild only that. This is not mandatory, as in the docker-compose.dev.yml we already mounted the code in the container, but when you want to try to build the image, is enough to do:
./build_dev.sh newesapp -s
4.3. Start the whole stack
In eea.docker.searchservices start the whole stack with:
docker-compose -f docker-compose.dev.yml up
4.4. Test in the browser
In your favorite browser go to:
5. Add it to the production stack
After there is a first working version of the application, you should
- add it in the stack as a git submodule for eea.docker.searchservices
- create a git tag for eea.docker.newesapp
- add the application in https://hub.docker.com and enable automatic build on tags
- add your application in docker-compose.yml from eea.docker.searchservices and pin it to the tag you added
For details on implementation read the documentation.