Skip to content

Commit

Permalink
Revert pull request alerta#108
Browse files Browse the repository at this point in the history
  • Loading branch information
satterly committed Mar 20, 2019
1 parent c6864a7 commit 3cfb148
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 45 deletions.
99 changes: 54 additions & 45 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,61 +1,70 @@
FROM python:3.6
ENV PYTHONUNBUFFERED 1

LABEL maintainer="Nick Satterly <[email protected]>" \
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"
LABEL maintainer="Nick Satterly <[email protected]>"

ARG BUILD_DATE
ARG VCS_REF
ARG VERSION

ENV PATH ${PATH}:/venv/bin
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 \
gettext-base \
git \
libffi-dev \
libldap2-dev \
libpq-dev \
libsasl2-dev \
mongodb-clients \
nginx \
postgresql-client \
postgresql-client-common \
python3-dev \
supervisor \
wget

RUN pip install --no-cache-dir virtualenv && \
virtualenv --python=python3 /venv && \
/venv/bin/pip install uwsgi alerta alerta-server==$VERSION
ENV PATH $PATH:/venv/bin

ADD https://github.com/alerta/angular-alerta-webui/archive/v$VERSION.tar.gz /tmp/web.tar.gz
RUN tar zxvf /tmp/web.tar.gz -C /tmp && \
mv /tmp/angular-alerta-webui-$VERSION/app /web && \
mv /web/config.json /web/config.json.orig

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_CONF_FILE /app/alerta.conf
ENV ALERTA_WEB_CONF_FILE /web/config.json
ENV BASE_URL /api
ENV INSTALL_PLUGINS ""
ENV PYTHONUNBUFFERED 1
ENV HEARTBEAT_SEVERITY major

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive 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 \
&& rm -rf /var/lib/apt/lists/*

ENV FOO 2

RUN pip install --no-cache-dir virtualenv \
&& virtualenv --python=python3 /venv \
&& /venv/bin/pip install uwsgi alerta \
&& /venv/bin/pip install https://github.com/alerta/alerta/archive/fix-redirect-500.zip

RUN wget -q -O - "https://github.com/alerta/angular-alerta-webui/archive/v${VERSION}.tar.gz" | tar xzf - -C /tmp/ \
&& mv /tmp/angular-alerta-webui-${VERSION}/app /web \
&& mv /web/config.json /web/config.json.orig \
&& rm -fr /tmp/angular-alerta-webui-${VERSION}

COPY slash/ /

RUN chgrp -R 0 /app /venv /web \
&& chmod -R g=u /app /venv /web \
&& useradd -r -d /app -u 1001 -g 0 alerta
ENV BASE_URL /api
ENV INSTALL_PLUGINS ""

USER 1001
EXPOSE 8080

COPY config.json.template /web/config.json.template
COPY docker-entrypoint.sh /
COPY supervisord.conf /app/supervisord.conf

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord", "-c", "/app/supervisord.conf"]

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3cfb148

Please sign in to comment.