forked from nopp/alertmanager-webhook-telegram-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (27 loc) · 803 Bytes
/
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
FROM python:3.7-alpine3.11 AS base
LABEL maintainer="Just a baka <[email protected]>"
# Build dependencies
FROM base as builder
RUN mkdir /install
WORKDIR /install
RUN apk update \
&& apk add gcc python3-dev libffi-dev musl-dev openssl-dev \
&& rm -rf /var/cache/apk/*
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# Build the final image
FROM base
COPY --from=builder /install /usr/local
ENV PYTHONUNBUFFERED=1 \
BOT_TOKEN="" \
CHAT_ID="" \
LOG_LEVEL="INFO" \
FORCE_BASIC_AUTH="False" \
BASIC_AUTH_USERNAME="" \
BASIC_AUTH_PASSWORD=""
WORKDIR /alertmanager-webhook-telegram
COPY flaskalert.py .
COPY templates/* templates/
EXPOSE 8080
USER nobody
ENTRYPOINT ["/usr/local/bin/gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "flaskalert:app"]