1- FROM ivankrizsan/elastalert AS py-ea
1+ FROM alpine:latest as py-ea
2+ ARG ELASTALERT_VERSION=v0.1.31
3+ ENV ELASTALERT_VERSION=${ELASTALERT_VERSION}
4+ # URL from which to download Elastalert.
5+ ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip
6+ ENV ELASTALERT_URL=${ELASTALERT_URL}
7+ # Elastalert home directory full path.
8+ ENV ELASTALERT_HOME /opt/elastalert
9+
10+ WORKDIR /opt
11+
12+ RUN apk add --update --no-cache ca-certificates openssl-dev openssl python2-dev python2 py2-pip py2-yaml libffi-dev gcc musl-dev wget && \
13+ # Download and unpack Elastalert.
14+ wget -O elastalert.zip "${ELASTALERT_URL}" && \
15+ unzip elastalert.zip && \
16+ rm elastalert.zip && \
17+ mv e* "${ELASTALERT_HOME}"
18+
19+ WORKDIR "${ELASTALERT_HOME}"
20+
21+ # Install Elastalert.
22+ # see: https://github.com/Yelp/elastalert/issues/1654
23+ RUN sed -i 's/jira>=1.0.10/jira>=1.0.10,<1.0.15/g' setup.py && \
24+ python setup.py install && \
25+ pip install -r requirements.txt
26+
227FROM node:alpine
328LABEL maintainer=
"BitSensor <[email protected] >" 4- EXPOSE 3030
29+ # Set this environment variable to True to set timezone on container start.
30+ ENV SET_CONTAINER_TIMEZONE False
31+ # Default container timezone as found under the directory /usr/share/zoneinfo/.
32+ ENV CONTAINER_TIMEZONE Etc/UTC
533
6- RUN apk add --update --no-cache python2 curl make
34+ RUN apk add --update --no-cache curl tzdata python2 make
735
836COPY --from=py-ea /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
937COPY --from=py-ea /opt/elastalert /opt/elastalert
38+ COPY --from=py-ea /usr/bin/elastalert* /usr/bin/
1039
11- RUN mkdir server_data
1240WORKDIR /opt/elastalert-server
1341COPY . /opt/elastalert-server
1442
@@ -18,4 +46,5 @@ COPY config/config.json config/config.json
1846COPY rule_templates/ /opt/elastalert/rule_templates
1947COPY elastalert_modules/ /opt/elastalert/elastalert_modules
2048
49+ EXPOSE 3030
2150ENTRYPOINT ["npm" , "start" ]
0 commit comments