Docker compose to bring up a Prometheus server

0 votes
Can somebody provide me with a docker-compose file to bring up a Prometheus server on a Linux system?

Thanks in advanace!
Oct 23, 2019 in Docker by Hannah
• 18,570 points
6,070 views

1 answer to this question.

0 votes

I think this docker-compose should be helpful. Have a look at it:

version: '3'
networks:
  monitor-net:
    driver: bridge
volumes:
    prometheus_data: {}
services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    volumes:
      - ./prometheus/:/etc/prometheus/
      - prometheus_data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/etc/prometheus/console_libraries'
      - '--web.console.templates=/etc/prometheus/consoles'
      - '--storage.tsdb.retention=200h'
      - '--web.enable-lifecycle'
    # restart: unless-stopped
    expose:
      - 9090
    ports:
      - "9090:9090"
    networks:
      - monitor-net
answered Oct 23, 2019 by Eric
Very Nice
But I have a question

Where is the prometheus.yml file located and what changes we have to do in embedding that file. What is the location of that file?

You can find prometheus.yml file inside /etc/prometheus folder.

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,436 views
0 votes
1 answer

Convert a Docker container into a Singularity container

Its pretty simple. You can just use ...READ MORE

answered Nov 26, 2019 in Docker by Priyank
1,437 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP