Sign inSign up

mosstech/nginx-with-prometheus

By mosstech

Updated over 2 years ago

NGINX with Prometheus - see README at https://github.com/alexdmoss/nginx-with-prometheus

Image
0

1.7K

mosstech/nginx-with-prometheus repository overview

nginx-with-prometheus

Instrumented open-source NGINX with Prometheus metrics from: https://github.com/knyar/nginx-lua-prometheus/blob/master/prometheus.lua

Base Dockerfile based heavily on: https://hub.docker.com/r/ekho/nginx-lua/dockerfile, with tweaks to bring in up-to-date versions.

Usage

Build for Docker Hub

It's hooked up to their auto-build setup. Use as follows:

git tag -a 1.2 -m "something that describes the change"
git push origin 1.2
Base Image

Build base image with docker build -t nginx-with-prometheus . (replace with your own tag as needed).

You can test this with: docker run -p 8080:8080 -p 9145:9145 nginx-with-prometheus:latest - curl http://localhost:8080/ should 404, and curl http://localhost:9145/metrics should show you some metrics.

Use It

Once built, you can use it for a "proper" website with a Dockerfile like this:

# NB: don't really use latest ...
FROM nginx-with-prometheus:latest
# path to where your code actually is
COPY example/index.html /app/
# customisations you'll inevitably want on base nginx
COPY example/default.conf /etc/nginx/conf.d/

Which you can then build and run as usual:

docker build -t your-website -f Example.Dockerfile .
docker run -p 8080:8080 -p 9145:9145 your-website

Tag summary

Content type

Image

Digest

Size

54.4 MB

Last updated

over 6 years ago

docker pull mosstech/nginx-with-prometheus