forked from alerta/docker-alerta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
95 lines (75 loc) · 2.85 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM python:3.7
ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
LABEL maintainer="Nick Satterly <[email protected]>"
ARG BUILD_DATE=now
ARG VCS_REF
ARG VERSION
ENV SERVER_VERSION=${VERSION}
ENV CLIENT_VERSION=8.3.0
ENV WEBUI_VERSION=8.3.2
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"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add - && \
echo "deb https://nginx.org/packages/debian/ buster nginx" | tee /etc/apt/sources.list.d/nginx.list
# hadolint ignore=DL3008
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - && \
echo "deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
gettext-base \
libffi-dev \
libldap2-dev \
libpq-dev \
libsasl2-dev \
mongodb-org-shell \
nginx \
postgresql-client \
python3-dev \
supervisor \
wget \
xmlsec1 && \
apt-get -y clean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/*
COPY requirements*.txt /app/
# hadolint ignore=DL3013
RUN pip install --no-cache-dir pip virtualenv && \
python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir --upgrade setuptools && \
/venv/bin/pip install --no-cache-dir --requirement /app/requirements.txt && \
/venv/bin/pip install --no-cache-dir --requirement /app/requirements-docker.txt
ENV PATH $PATH:/venv/bin
RUN /venv/bin/pip install alerta==${CLIENT_VERSION} alerta-server==${SERVER_VERSION}
COPY install-plugins.sh /app/install-plugins.sh
COPY plugins.txt /app/plugins.txt
RUN /app/install-plugins.sh
ENV ALERTA_SVR_CONF_FILE /app/alertad.conf
ENV ALERTA_CONF_FILE /app/alerta.conf
ADD https://github.com/alerta/alerta-webui/releases/download/v${WEBUI_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 /web/config.json
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 \
&& ln -sf /dev/stderr /var/log/nginx/error.log
RUN chgrp -R 0 /app /venv /web && \
chmod -R g=u /app /venv /web && \
useradd -u 1001 -g 0 -d /app alerta
USER 1001
ENV HEARTBEAT_SEVERITY major
ENV HK_EXPIRED_DELETE_HRS 2
ENV HK_INFO_DELETE_HRS 12
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"]