Skip to content

Commit 617fbfc

Browse files
author
Khanh Nguyen
committed
Updated dockerfile based on node:alpine and ivankrizan/elastalert
1 parent 00f494e commit 617fbfc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
*.iml
55
.idea/
66
.git/
7+
node_modules/
8+
lib/

Dockerfile

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
FROM node
1+
FROM ivankrizsan/elastalert AS py-ea
2+
3+
FROM node:alpine
24
MAINTAINER BitSensor <[email protected]>
35
EXPOSE 3030
6+
7+
RUN apk update && apk upgrade && apk add python2
8+
9+
COPY --from=py-ea /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
10+
COPY --from=py-ea /opt/elastalert /opt/elastalert
411

5-
RUN apt-get clean && apt-get update && apt-get install -y \
6-
git \
7-
python2.7 \
8-
python2.7-dev \
9-
python-pip
10-
RUN git clone https://github.com/Yelp/elastalert.git -b master --depth=1 /opt/elastalert
11-
WORKDIR /opt/elastalert
1212
RUN mkdir server_data
13-
RUN pip install -r requirements.txt
14-
WORKDIR /opt/elastalert-server
15-
ADD . /opt/elastalert-server
16-
ADD rule_templates/ /opt/elastalert/rule_templates/
17-
ADD rules/ /opt/elastalert/rules/
18-
RUN npm install --production --quiet
19-
ADD config/elastalert.yaml /opt/elastalert/config.yaml
20-
ADD config/elastalert-server.json config/config.json
21-
ENTRYPOINT ["npm", "start"]
13+
WORKDIR /opt/elastalert-server
14+
COPY . /opt/elastalert-server
15+
16+
RUN npm install --production --quiet
17+
COPY config/elastalert.yaml /opt/elastalert/config.yaml
18+
COPY config/elastalert-server.json config/config.json
19+
ENTRYPOINT ["npm", "start"]

0 commit comments

Comments
 (0)