Skip to content

Commit

Permalink
Merge pull request #176 from idealista/features/175
Browse files Browse the repository at this point in the history
#175 Using multi-stage build to create prom2teams image
  • Loading branch information
dortegau committed Apr 13, 2020
2 parents a09dd3a + d860460 commit 4732a5e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## [Unreleased](https://github.com/idealista/prom2teams/tree/develop)
## Changed
- *[#175](https://github.com/idealista/prom2teams/issues/175) Building docker image using multi-stage build feature* @dortegau

## Fixed
- *[#158](https://github.com/idealista/prom2teams/issues/158) Fixing Travis Badge (pointing to master branch) and reordering TOC* @dortegau
Expand Down
33 changes: 15 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
FROM python:3.5-alpine

LABEL maintainer="labs@idealista.com"

EXPOSE 8089

RUN apk add gcc libc-dev linux-headers --no-cache

WORKDIR /opt/prom2teams

COPY ./docker/ \
LICENSE \
FROM python:3.5-alpine AS builder
WORKDIR /prom2teams
COPY LICENSE \
MANIFEST.in \
README.md \
requirements.txt \
setup.py \
./
COPY prom2teams/ prom2teams
COPY bin/ bin
RUN apk add gcc libc-dev linux-headers --no-cache \
&& python setup.py bdist_wheel

COPY ./bin bin
COPY ./prom2teams prom2teams

RUN python setup.py install

FROM python:3.5-alpine
LABEL maintainer="labs@idealista.com"
EXPOSE 8089
WORKDIR /opt/prom2teams
COPY docker/rootfs .
COPY --from=builder /prom2teams/dist .
RUN apk add gcc libc-dev linux-headers --no-cache \
&& pip install prom2teams*.whl
ENV PROM2TEAMS_PORT="8089" \
PROM2TEAMS_HOST="0.0.0.0" \
PROM2TEAMS_LOGLEVEL="INFO" \
PROM2TEAMS_CONNECTOR="" \
PROM2TEAMS_GROUP_ALERTS_BY="" \
APP_CONFIG_FILE="/opt/prom2teams/config.ini" \
PROM2TEAMS_PROMETHEUS_METRICS="true"

ENTRYPOINT ["sh", "prom2teams_start.sh"]
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4732a5e

Please sign in to comment.