elastalert
elastalert copied to clipboard
Create index elastalert from config when run docker
Starting the docker a container with elastalert I don't extort separately the elastalert project to receive create_index.py the file. And for correct work it is required to create the index before start. It wouldn't be more logical to add creation of the index from a config at start of a container? If the index with such name already exists, it it is simple to pass a stage of creation of the new index and earlier created will be used.
For example: For myself I have finished your Dockerfile.
RUN npm install --production --quiet
COPY config/elastalert.yaml /opt/elastalert/config.yaml
COPY config/config.json config/config.json
COPY rule_templates/ /opt/elastalert/rule_templates
COPY elastalert_modules/ /opt/elastalert/elastalert_modules
RUN chmod ugo+x /opt/elastalert/elastalert/create_index.py && \
echo "#!/bin/bash" > /opt/elastalert/createindex.sh && \
echo "python /opt/elastalert/elastalert/create_index.py --config /opt/elastalert/config.yaml" >> /opt/elastalert/createindex.sh && \
echo "npm start" >> /opt/elastalert/createindex.sh && \
chmod ugo+x /opt/elastalert/createindex.sh
EXPOSE 3030
ENTRYPOINT ["/opt/elastalert/createindex.sh"]