Skip to content

Commit

Permalink
Merge pull request #66 from gapitio/docker_build
Browse files Browse the repository at this point in the history
build: add build of gapit image
  • Loading branch information
sbgap authored Apr 23, 2024
2 parents 2fd9c92 + d0fa267 commit a4e0fc3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 36 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/gapit_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
RELEASE=${{ github.ref_name }}
VERSION=${{ github.sha }}
43 changes: 13 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
FROM node:16-alpine as build-stage

ADD https://github.com/gapitio/alerta-webui/archive/refs/heads/gapit_notifications.tar.gz /tmp/webui.tar.gz
RUN apk add --no-cache git==2.40.1-r0
RUN tar zxvf /tmp/webui.tar.gz -C /tmp
WORKDIR /tmp/alerta-webui-gapit_notifications
RUN npm install && \
npm run build --fix && \
mv dist /web


FROM python:3.9-slim-buster as production-stage
WORKDIR /
COPY --from=build-stage /web /web


ENV PYTHONUNBUFFERED 1
Expand All @@ -22,9 +10,9 @@ ARG BUILD_DATE
ARG RELEASE
ARG VERSION

ENV SERVER_VERSION=8.5.0
ENV SERVER_VERSION=${RELEASE}
ENV CLIENT_VERSION=8.5.0
ENV WEBUI_VERSION=8.5.0
ENV WEBUI_VERSION=${RELEASE}

ENV NGINX_WORKER_PROCESSES=1
ENV NGINX_WORKER_CONNECTIONS=1024
Expand All @@ -40,12 +28,12 @@ ENV HK_EXPIRED_DELETE_HRS=2
ENV HK_INFO_DELETE_HRS=12

LABEL org.opencontainers.image.description="Alerta API (prod)" \
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
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

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down Expand Up @@ -102,24 +90,19 @@ ENV PATH $PATH:/venv/bin
ADD https://github.com/gapitio/python-alerta-client/archive/refs/heads/gapit.tar.gz /tmp/client/client.tar.gz
RUN tar zxvf /tmp/client/client.tar.gz -C /tmp/client/ && \
/venv/bin/pip install /tmp/client/python-alerta-client-gapit/.
# RUN /venv/bin/pip install alerta==${CLIENT_VERSION}
# ADD https://github.com/gapitio/alerta/releases/download/v${SERVER_VERSION}}/alerta.tar.gz /tmp/backend/alerta.tar.gz
ADD https://github.com/gapitio/alerta/archive/refs/heads/gapit_notification.tar.gz /tmp/backend/alerta.tar.gz
ADD https://github.com/gapitio/alerta/releases/download/v${SERVER_VERSION}/alerta-api.tar.gz /tmp/backend/alerta.tar.gz
RUN tar zxvf /tmp/backend/alerta.tar.gz -C /tmp/backend && \
/venv/bin/pip install /tmp/backend/alerta-gapit_notification/.
find /tmp/backend/dist -name "*-py2.py3-none-any.whl" -print0 | xargs -0 -I{} /venv/bin/pip install {}
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
# ADD https://github.com/gapitio/alerta-webui/archive/refs/heads/gapit_notification.tar.gz /tmp/webui.tar.gz
# RUN tar zxvf /tmp/webui.tar.gz -C /tmp && \
# cd /tmp/alerta-webui-gapit_notification && \
# npm run build && \
# mv /tmp/alerta-webui-gapit_notification/dist /web
ADD https://github.com/gapitio/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

ENV ALERTA_SVR_CONF_FILE /app/alertad.conf
ENV ALERTA_CONF_FILE /app/alerta.conf
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.3
1.5.0
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bcrypt==4.1.2
blinker==1.7.0
cryptography==42.0.5
Flask==3.0.2
Flask==3.0.3
Flask-Compress==1.14
Flask-Cors==4.0.0
mohawk==1.1.0
Expand All @@ -10,14 +10,14 @@ PyJWT==2.8.0
pymongo==4.4.1
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-http-client==3.2.1
pytz==2024.1
PyYAML==6.0.1
requests==2.31.0
requests_hawk==1.2.1
sentry-sdk[flask]==1.43.0
StrEnum==0.4.15
werkzeug==3.0.1
sendgrid==6.5.0
python-http-client==3.2.1
sentry-sdk[flask]==1.45.0
starkbank-ecdsa==1.0.0
StrEnum==0.4.15
twilio==7.0.0
werkzeug==3.0.2

0 comments on commit a4e0fc3

Please sign in to comment.