|
| 1 | +version: '2' |
| 2 | + |
| 3 | +# Make sure to create the sub directories "prometheus", "prometheus_data", "grafana", "grafana_data" and "certstream" |
| 4 | +# and create the config files for all three services. For further details please refer to https://github.com/d-Rickyy-b/certstream-server-go/wiki/Collecting-and-Visualizing-Metrics |
| 5 | + |
| 6 | +networks: |
| 7 | + monitoring: |
| 8 | + driver: bridge |
| 9 | + ipam: |
| 10 | + config: |
| 11 | + - subnet: 172.90.0.0/24 |
| 12 | + gateway: 172.90.0.1 |
| 13 | + |
| 14 | +services: |
| 15 | + prometheus: |
| 16 | + image: prom/prometheus:v2.40.5 |
| 17 | + restart: always |
| 18 | + # Configure the service to run as specific user. |
| 19 | + # user: "1000:1000" |
| 20 | + volumes: |
| 21 | + - ./prometheus/:/etc/prometheus/ |
| 22 | + - ./prometheus_data:/prometheus/ |
| 23 | + command: |
| 24 | + - '--config.file=/etc/prometheus/prometheus.yml' |
| 25 | + - '--storage.tsdb.path=/prometheus' |
| 26 | + - '--storage.tsdb.retention.time=1y' |
| 27 | + - '--web.console.libraries=/etc/prometheus/console_libraries' |
| 28 | + - '--web.console.templates=/etc/prometheus/consoles' |
| 29 | + - '--web.enable-lifecycle' |
| 30 | + ports: |
| 31 | + # Exposing Prometheus is NOT required, if you don't want to access it from outside the Docker network. |
| 32 | + # Using localhost enables you to use a reverse proxy (e.g. with basic auth) to access Prometheus in a more secure way. |
| 33 | + - 127.0.0.1:9090:9090 |
| 34 | + networks: |
| 35 | + - monitoring |
| 36 | + extra_hosts: |
| 37 | + - "host.docker.internal:host-gateway" |
| 38 | + |
| 39 | + grafana: |
| 40 | + image: grafana/grafana:9.3.1 |
| 41 | + restart: always |
| 42 | + # Configure the service to run as specific user. |
| 43 | + # user: "1000:1000" |
| 44 | + depends_on: |
| 45 | + - prometheus |
| 46 | + ports: |
| 47 | + - 127.0.0.1:8082:3000 |
| 48 | + volumes: |
| 49 | + - ./grafana_data:/var/lib/grafana |
| 50 | + - ./grafana/provisioning/:/etc/grafana/provisioning/ |
| 51 | + env_file: |
| 52 | + # changes to the grafana env file require a rebuild of the container. |
| 53 | + - ./grafana/config.monitoring |
| 54 | + networks: |
| 55 | + - monitoring |
| 56 | + |
| 57 | + certstream: |
| 58 | + image: 0rickyy0/certstream-server-go:latest |
| 59 | + restart: always |
| 60 | + # Configure the service to run as specific user. |
| 61 | + # user: "1000:1000" |
| 62 | + ports: |
| 63 | + - 127.0.0.1:8080:80 |
| 64 | + # Don't forget to open the other port in case you run the Prometheus endpoint on another port than the websocket server. |
| 65 | + # - 127.0.0.1:8081:81 |
| 66 | + volumes: |
| 67 | + - ./certstream/config.yml:/app/config.yml |
| 68 | + networks: |
| 69 | + - monitoring |
0 commit comments