Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var to define elastalert_home used #73

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 13 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ARG ELASTALERT_HOME=/opt/elastalert

FROM alpine:latest as py-ea
ARG ELASTALERT_VERSION=v0.1.38
ENV ELASTALERT_VERSION=${ELASTALERT_VERSION}
# URL from which to download Elastalert.
ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip
ENV ELASTALERT_URL=${ELASTALERT_URL}
# Elastalert home directory full path.
ENV ELASTALERT_HOME /opt/elastalert
ARG ELASTALERT_HOME

WORKDIR /opt

Expand All @@ -21,29 +23,32 @@ WORKDIR "${ELASTALERT_HOME}"
# Install Elastalert.
# see: https://github.com/Yelp/elastalert/issues/1654
RUN sed -i 's/jira>=1.0.10/jira>=1.0.10,<1.0.15/g' setup.py && \
python setup.py install && \
pip install -r requirements.txt
pip install -r requirements.txt && \
python setup.py install

FROM node:alpine
LABEL maintainer="BitSensor <dev@bitsensor.io>"
# Set timezone for this container
ENV TZ Etc/UTC
# Elastalert home directory full path.
ARG ELASTALERT_HOME

RUN apk add --update --no-cache curl tzdata python2 make libmagic

COPY --from=py-ea /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
COPY --from=py-ea /opt/elastalert /opt/elastalert
COPY --from=py-ea "${ELASTALERT_HOME}" "${ELASTALERT_HOME}"
COPY --from=py-ea /usr/bin/elastalert* /usr/bin/

WORKDIR /opt/elastalert-server
COPY . /opt/elastalert-server

RUN npm install --production --quiet
COPY config/elastalert.yaml /opt/elastalert/config.yaml
COPY config/elastalert-test.yaml /opt/elastalert/config-test.yaml
COPY config/elastalert.yaml "${ELASTALERT_HOME}"/config.yaml
COPY config/elastalert-test.yaml "${ELASTALERT_HOME}"/config-test.yaml
COPY config/config.json config/config.json
COPY rule_templates/ /opt/elastalert/rule_templates
COPY elastalert_modules/ /opt/elastalert/elastalert_modules
RUN sed -i "s|ELASTALERT_HOME|${ELASTALERT_HOME}|" config/config.json
COPY rule_templates/ "${ELASTALERT_HOME}"/rule_templates
COPY elastalert_modules/ "${ELASTALERT_HOME}"/elastalert_modules

EXPOSE 3030
ENTRYPOINT ["npm", "start"]
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"appName": "elastalert-server",
"port": 3030,
"elastalertPath": "/opt/elastalert",
"elastalertPath": "ELASTALERT_HOME",
"verbose": false,
"es_debug": false,
"debug": false,
Expand Down