Skip to content

Instantly share code, notes, and snippets.

@tikg
Created October 25, 2025 10:57
Show Gist options
  • Select an option

  • Save tikg/de0130d38ba1209e7e2c16484e281391 to your computer and use it in GitHub Desktop.

Select an option

Save tikg/de0130d38ba1209e7e2c16484e281391 to your computer and use it in GitHub Desktop.
Setting up my SRE environment

Setting up my SRE environment

Install the following

  • Docker
  • Colima (Linux/Mac)
  • Nginx
  • Kubernetes
  • Ansible / Chef
  • Terraform
  • Ruby on Rails
  • Springboot
@tikg
Copy link
Author

tikg commented Oct 25, 2025

Prometheus and Grafana with docker compose

Compose file here:

Verify Docker Compose UP
image

Verify Prometheus
image

Verify Grafana
image

Setup Prometheus on Grafana
image

Confirm Prometheus in Grafana
image

Grafana admin
image

Reconfirm Docker Compose Up with Mimir
image

Checking Targets from Prom
image

Check if mimir is healthy

tik@tik-1tb:~/Desktop/dockerz$ docker compose down; docker compose up -d
[+] Running 4/4
 ✔ Container grafana           Removed                                                                                                                                           0.2s 
 ✔ Container prometheus        Removed                                                                                                                                          10.2s 
 ✔ Container mimir             Removed                                                                                                                                           0.1s 
 ✔ Network dockerz_monitoring  Removed                                                                                                                                           0.2s 
[+] Running 4/4
 ✔ Network dockerz_monitoring  Created                                                                                                                                           0.0s 
 ✔ Container mimir             Started                                                                                                                                           0.4s 
 ✔ Container prometheus        Started                                                                                                                                           0.4s 
 ✔ Container grafana           Started                                                                                                                                           0.5s 
tik@tik-1tb:~/Desktop/dockerz$ 
tik@tik-1tb:~/Desktop/dockerz$ curl http://localhost:9009/prometheus/api/v1/status/buildinfo
{"status":"success","data":{"application":"Grafana Mimir","version":"2.16.2","revision":"12bba40","branch":"HEAD","goVersion":"go1.23.12","features":{"ruler_config_api":"true","alertmanager_config_api":"true","query_sharding":"false","federated_rules":"false"}}}tik@tik-1tb:~/Desktop/dockerz$ 

curl http://localhost:9009/prometheus/api/v1/status/buildinfo

@tikg
Copy link
Author

tikg commented Oct 25, 2025

Docker Compose file Prometheus, Grafana, Mimir

tik@tik-1tb:~/Desktop/SRE$ cat monitoring-stack.yml 
services:
  
  nginx:
    image: nginx:latest
    container_name: nginx
    ports:
      - "8080:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    networks:
      - monitoring

  nginx-exporter:
    image: nginx/nginx-prometheus-exporter:latest
    container_name: nginx-exporter
    command: ["-nginx.scrape-uri", "http://nginx:80/stub_status"]
    ports:
      - "9113:9113"
    depends_on:
      - nginx
    networks:
      - monitoring

  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    command:
      - "--config.file=/etc/prometheus/prometheus.yml"
      - "--web.enable-lifecycle"
    networks:
      - monitoring

  mimir:
    image: grafana/mimir:latest
    container_name: mimir
    command:
      - "-target=all"
      - "-config.expand-env=true"
      - "-server.http-listen-port=9009"
      - "-auth.multitenancy-enabled=false"
    ports:
      - "9009:9009"
    networks:
      - monitoring

#  mimir:
#    image: grafana/mimir:latest
#    container_name: mimir
#    ports:
#      - "9009:9009"
#    command: ["-config.expand-env=true"]
#    networks:
#      - monitoring

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    ports:
      - "3000:3000"
    depends_on:
      - prometheus
      - mimir
    networks:
      - monitoring
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin

networks:
  monitoring:
    driver: bridge


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment