Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#175 Using multi-stage build to create prom2teams image #176

Merged
merged 5 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.