Created
February 22, 2020 08:32
-
-
Save wshihadeh/1ebc6f36cf04ae4d685855b12a2c4192 to your computer and use it in GitHub Desktop.
Prometheus Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
echo "Configuration file:" | |
sed -e "s/@TRAEFIK_USERNAME/${TRAEFIK_USERNAME}/" \ | |
-e "s/@TRAEFIK_PASSWORD/${TRAEFIK_PASSWORD}/" \ | |
-i /etc/prometheus/prometheus.yml | |
set -- /bin/prometheus "$@" | |
exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM prom/prometheus:v2.16.0 | |
COPY prometheus.yml /etc/prometheus/prometheus.yml | |
COPY ./docker-entrypoint.sh /etc/prometheus/ | |
ENTRYPOINT [ "/etc/prometheus/docker-entrypoint.sh" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
external_labels: | |
monitor: 'traefik-Monitoring' | |
# A scrape configuration containing exactly one endpoint to scrape: | |
# Here it's Prometheus itself. | |
scrape_configs: | |
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. | |
- job_name: 'local_traefik' | |
scrape_interval: 15s | |
scrape_timeout: 10s | |
metrics_path: /metrics | |
scheme: http | |
static_configs: | |
- targets: | |
- traefik_proxy:8082 | |
basic_auth: | |
username: @TRAEFIK_USERNAME | |
password: '@TRAEFIK_PASSWORD' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment