hellofresh / mysql-replication-monitor

A Python MySQL Replication Monitor with Slack and Email notifications
MIT License
11 stars 8 forks source link

Add Docker support #6

Closed pataquets closed 6 years ago

pataquets commented 6 years ago

Add Dockerfile to enable image building. Useful for development and tests under Docker workflow. Using the official Python image, pinned to 2.x tag. More info at https://hub.docker.com/_/python/

Just adding files, installing protobuf dependencies, setting working dir and running build. No config file built-in other than the template, to allow the image to be used as a 'clean base' by building in whatever config people feel like. It can also be mounted from outside of the container (as done in the examples below).

Build:

$ docker build -t mysql-replication-monitor .

Run:

$ docker run --rm -it -v /your/host/config.yml:/usr/src/app/config.yml mysql-replication-monitor [options]

FYI, there's a still quicker to test, already built image on my Docker Hub. Test it by running:

$ docker run --rm -it -v /your/host/config.yml:/usr/src/app/config.yml pataquets/mysql-replication-monitor [options...]

Using --rm causes the container to be deleted after stop.

Optional improvement to come (maybe in another issue):

mandoz commented 6 years ago

+1

Approved with PullApprove Approved with PullApprove Approved with PullApprove