Skip to content

Commit c96f94c

Browse files
committed
feat: implement docker-compose files
1 parent 350df76 commit c96f94c

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

docker/docker-compose.metrics.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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

docker/docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: '2'
2+
3+
services:
4+
certstream:
5+
image: 0rickyy0/certstream-server-go:latest
6+
restart: always
7+
# Configure the service to run as specific user
8+
# user: "1000:1000"
9+
ports:
10+
- 127.0.0.1:8080:80
11+
# Don't forget to open the other port in case you run the Prometheus endpoint on another port than the websocket server.
12+
# - 127.0.0.1:8081:81
13+
volumes:
14+
- ./certstream/config.yml:/app/config.yml
15+
networks:
16+
- monitoring

0 commit comments

Comments
 (0)