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 update && apk upgrade && \
13+ apk add ca-certificates openssl-dev openssl python2-dev python2 py2-pip py2-yaml libffi-dev gcc musl-dev wget && \
14+ # Download and unpack Elastalert.
15+ wget -O elastalert.zip "${ELASTALERT_URL}" && \
16+ unzip elastalert.zip && \
17+ rm elastalert.zip && \
18+ mv e* "${ELASTALERT_HOME}"
19+
20+ WORKDIR "${ELASTALERT_HOME}"
21+
22+ # Install Elastalert.
23+ RUN python setup.py install && \
24+ pip install -r requirements.txt
25+
226FROM node:alpine
327LABEL maintainer=
"BitSensor <[email protected] >" 4- EXPOSE 3030
28+ # Set this environment variable to True to set timezone on container start.
29+ ENV SET_CONTAINER_TIMEZONE False
30+ # Default container timezone as found under the directory /usr/share/zoneinfo/.
31+ ENV CONTAINER_TIMEZONE Etc/UTC
532
6- RUN apk add --update -- no-cache python2 curl make
33+ RUN apk update && apk upgrade && apk add --no-cache curl tzdata python2
734
835COPY --from=py-ea /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
936COPY --from=py-ea /opt/elastalert /opt/elastalert
37+ COPY --from=py-ea /usr/bin/elastalert* /usr/bin/
1038
11- RUN mkdir server_data
1239WORKDIR /opt/elastalert-server
1340COPY . /opt/elastalert-server
1441
@@ -18,4 +45,5 @@ COPY config/config.json config/config.json
1845COPY rule_templates/ /opt/elastalert/rule_templates
1946COPY elastalert_modules/ /opt/elastalert/elastalert_modules
2047
48+ EXPOSE 3030
2149ENTRYPOINT ["npm" , "start" ]
0 commit comments