forked from alerta/docker-alerta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
74 lines (59 loc) · 2.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM python:3.6
ENV PYTHONUNBUFFERED 1
LABEL maintainer="Nick Satterly <[email protected]>"
ARG BUILD_DATE=now
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.url="https://alerta.io" \
org.label-schema.vcs-url="https://github.com/alerta/docker-alerta" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0.0-rc.1"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gettext-base \
libffi-dev \
libldap2-dev \
libpq-dev \
libsasl2-dev \
mongodb-clients \
nginx-light \
postgresql-client \
python3-dev \
supervisor \
wget && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir virtualenv && \
virtualenv --python=python3 /venv && \
/venv/bin/pip install -r /app/requirements.txt
ENV PATH $PATH:/venv/bin
RUN /venv/bin/pip install alerta alerta-server==$VERSION
COPY install-plugins.sh /app/install-plugins.sh
COPY plugins.txt /app/plugins.txt
RUN /app/install-plugins.sh
ADD https://github.com/alerta/alerta-webui/releases/download/v${VERSION}/alerta-webui.tar.gz /tmp/webui.tar.gz
RUN tar zxvf /tmp/webui.tar.gz -C /tmp && \
mv /tmp/dist /web
COPY config.json.template /web/config.json.template
COPY wsgi.py /app/wsgi.py
COPY uwsgi.ini /app/uwsgi.ini
COPY nginx.conf /app/nginx.conf
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stdout /var/log/nginx/error.log
RUN chgrp -R 0 /app /venv /web && \
chmod -R g=u /app /venv /web && \
useradd -u 1001 -g 0 alerta
USER 1001
ENV ALERTA_SVR_CONF_FILE /app/alertad.conf
ENV ALERTA_CONF_FILE /app/alerta.conf
ENV ALERTA_WEB_CONF_FILE /web/config.json
ENV BASE_URL /api
ENV HEARTBEAT_SEVERITY major
COPY docker-entrypoint.sh /usr/local/bin/
COPY supervisord.conf /app/supervisord.conf
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 8080
CMD ["supervisord", "-c", "/app/supervisord.conf"]