forked from alerta/alerta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (40 loc) · 1.35 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
FROM python:3.9-slim-buster
ARG BUILD_DATE
ARG BUILD_NUMBER
ARG RELEASE
ARG VERSION
LABEL org.opencontainers.image.description="Alerta API (dev)" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.url="https://github.com/alerta/alerta/pkgs/container/alerta-api" \
org.opencontainers.image.source="https://github.com/alerta/alerta" \
org.opencontainers.image.version=$RELEASE \
org.opencontainers.image.revision=$VERSION \
org.opencontainers.image.licenses=Apache-2.0
ENV ALERTA_ENDPOINT=http://localhost:8080
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
gnupg2 \
libldap2-dev \
libpq-dev \
libsasl2-dev \
postgresql-client \
python3-dev \
xmlsec1 && \
apt-get -y clean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/*
COPY . /app
WORKDIR /app
RUN echo "BUILD_NUMBER = '$BUILD_NUMBER'" > alerta/build.py && \
echo "BUILD_DATE = '$BUILD_DATE'" >> alerta/build.py && \
echo "BUILD_VCS_NUMBER = '$VERSION'" >> alerta/build.py
RUN python -m pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install -r requirements-ci.txt && \
pip install .
EXPOSE 8080
ENV FLASK_SKIP_DOTENV=1
CMD ["alertad", "run", "--host", "0.0.0.0", "--port", "8080"]