1- FROM alpine:latest as py-ea
2- ARG ELASTALERT_VERSION=v0.2.0b2
1+ FROM python:3.6-alpine as py-ea
2+ ARG ELASTALERT_VERSION=v0.2.1
33ENV ELASTALERT_VERSION=${ELASTALERT_VERSION}
44# URL from which to download Elastalert.
55ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip
@@ -9,7 +9,7 @@ ENV ELASTALERT_HOME /opt/elastalert
99
1010WORKDIR /opt
1111
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 && \
12+ RUN apk add --update --no-cache ca-certificates openssl-dev openssl libffi-dev gcc musl-dev wget && \
1313# Download and unpack Elastalert.
1414 wget -O elastalert.zip "${ELASTALERT_URL}" && \
1515 unzip elastalert.zip && \
@@ -25,15 +25,14 @@ RUN sed -i 's/jira>=1.0.10/jira>=1.0.10,<1.0.15/g' setup.py && \
2525 pip install -r requirements.txt
2626
2727FROM node:alpine
28- LABEL maintainer="BitSensor <dev@bitsensor.io >"
28+ LABEL maintainer="Securely <developer@securely.ai >"
2929# Set timezone for this container
3030ENV TZ Etc/UTC
3131
32- RUN apk add --update --no-cache curl tzdata python2 make libmagic
32+ RUN apk add --update --no-cache curl tzdata python3=3.6.8-r2 make libmagic
3333
34- COPY --from=py-ea /usr/lib/python2.7 /site-packages /usr/lib/python2.7 /site-packages
34+ COPY --from=py-ea /usr/local/ lib/python3.6 /site-packages /usr/lib/python3.6 /site-packages
3535COPY --from=py-ea /opt/elastalert /opt/elastalert
36- COPY --from=py-ea /usr/bin/elastalert* /usr/bin/
3736
3837WORKDIR /opt/elastalert-server
3938COPY . /opt/elastalert-server
@@ -47,8 +46,9 @@ COPY elastalert_modules/ /opt/elastalert/elastalert_modules
4746
4847# Add default rules directory
4948# Set permission as unpriviledged user (1000:1000), compatible with Kubernetes
50- RUN mkdir -p /opt/elastalert/rules/ /opt/elastalert/server_data/tests/ \
51- && chown -R node:node /opt
49+ RUN ln -s /usr/bin/python3 /usr/bin/python && \
50+ mkdir -p /opt/elastalert/rules/ /opt/elastalert/server_data/tests/ && \
51+ chown -R node:node /opt
5252
5353USER node
5454
0 commit comments