NGINX with Prometheus - see README at https://github.com/alexdmoss/nginx-with-prometheus
1.7K
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.
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
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.
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
Content type
Image
Digest
Size
54.4 MB
Last updated
over 6 years ago
docker pull mosstech/nginx-with-prometheus