Skip to content

Commit b397988

Browse files
committed
Linting
- Updating compose files based on linter output. - Updating workflow to check all compose files in ./docker/ - Updated dclintrc to ignore quotes for ports (default only passes with single quotes, not double quotes)
1 parent c3dfef5 commit b397988

File tree

3 files changed

+70
-69
lines changed

3 files changed

+70
-69
lines changed

.dclintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
rules:
44
services-alphabetical-order: 0
55
service-image-require-explicit-tag: 0
6+
require-quotes-in-ports: 0
67
quiet: false
78
debug: true

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1212
- uses: docker-compose-linter/dclint-github-action@18659f6a7956706cb67cf9c1ad5e55f4352cbc17 # 1.6.0
1313
with:
14-
path: ./docker/docker-compose.yml
14+
path: ./docker/
1515
recursive: true

docker/docker-compose.prom.yml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
x-common-vars:
2-
- &DOCKER_NETWORK ${DOCKER_NETWORK:-stacks}
3-
- &DOCKER_NETWORK_CIDR 10.0.0.0/24
4-
- &DOCKER_NETWORK_GATEWAY 10.0.0.1
5-
- &PROMETHEUS_IP 10.0.0.252
6-
- &CADVISOR_IP 10.0.0.253
2+
- &DOCKER_NETWORK ${DOCKER_NETWORK:-stacks}
3+
- &DOCKER_NETWORK_CIDR 10.0.0.0/24
4+
- &DOCKER_NETWORK_GATEWAY 10.0.0.1
5+
- &PROMETHEUS_IP 10.0.0.252
6+
- &CADVISOR_IP 10.0.0.253
77

88
name: monitoring
9-
10-
configs:
11-
# prometheus scraping config
12-
prometheus.yml:
13-
content: |
14-
# Global config
15-
global:
16-
external_labels:
17-
monitor: "hacknet"
18-
# A scrape configuration containing Prometheus and Docker
19-
scrape_configs:
20-
- job_name: cadvisor
21-
scrape_interval: 5s
22-
static_configs:
23-
- targets:
24-
- cadvisor:8080
25-
metric_relabel_configs:
26-
- source_labels: [ __name__ ]
27-
regex: '^(go_|cadvisor_version_info).+'
28-
action: drop
29-
- job_name: stacks
30-
scrape_interval: 5s
31-
static_configs:
32-
- targets:
33-
- stacks-miner-1:9153
34-
- stacks-miner-2:9153
35-
- stacks-miner-3:9153
369
services:
37-
prometheus:
38-
image: prom/prometheus:latest
39-
container_name: prometheus
40-
networks:
41-
default:
42-
ipv4_address: *PROMETHEUS_IP
43-
configs:
44-
- source: prometheus.yml
45-
target: /etc/prometheus/prometheus.yml
46-
depends_on:
47-
- cadvisor
48-
ports:
49-
- '0.0.0.0:${PROM_HTTP:-9090}:${PROM_HTTP:-9090}'
50-
command:
51-
- --config.file=/etc/prometheus/prometheus.yml
52-
cadvisor:
53-
image: gcr.io/cadvisor/cadvisor:latest
54-
container_name: cadvisor
55-
networks:
56-
default:
57-
ipv4_address: *CADVISOR_IP
58-
volumes:
59-
- /:/rootfs:ro
60-
- /var/run:/var/run:rw
61-
- /sys:/sys:ro
62-
- /var/lib/docker/:/var/lib/docker:ro
63-
ports:
64-
- '0.0.0.0:8080:8080'
65-
command: "--enable_metrics=cpu,cpuLoad,disk,diskIO,memory"
10+
prometheus:
11+
image: prom/prometheus:latest
12+
container_name: prometheus
13+
depends_on:
14+
- cadvisor
15+
configs:
16+
- source: prometheus.yml
17+
target: /etc/prometheus/prometheus.yml
18+
ports:
19+
- "0.0.0.0:9090:9090"
20+
networks:
21+
default:
22+
ipv4_address: *PROMETHEUS_IP
23+
command:
24+
- --config.file=/etc/prometheus/prometheus.yml
25+
cadvisor:
26+
image: gcr.io/cadvisor/cadvisor:latest
27+
container_name: cadvisor
28+
volumes:
29+
- /:/rootfs:ro
30+
- /var/run:/var/run:rw
31+
- /sys:/sys:ro
32+
- /var/lib/docker/:/var/lib/docker:ro
33+
ports:
34+
- "0.0.0.0:8080:8080"
35+
networks:
36+
default:
37+
ipv4_address: *CADVISOR_IP
38+
command: "--enable_metrics=cpu,cpuLoad,disk,diskIO,memory"
6639

6740
networks:
68-
default:
69-
name: *DOCKER_NETWORK
70-
ipam:
71-
driver: default
72-
config:
73-
- subnet: *DOCKER_NETWORK_CIDR
74-
gateway: *DOCKER_NETWORK_GATEWAY
41+
default:
42+
name: *DOCKER_NETWORK
43+
ipam:
44+
driver: default
45+
config:
46+
- subnet: *DOCKER_NETWORK_CIDR
47+
gateway: *DOCKER_NETWORK_GATEWAY
48+
49+
configs:
50+
# prometheus scraping config
51+
prometheus.yml:
52+
content: |
53+
# Global config
54+
global:
55+
external_labels:
56+
monitor: "hacknet"
57+
# A scrape configuration containing Prometheus and Docker
58+
scrape_configs:
59+
- job_name: cadvisor
60+
scrape_interval: 5s
61+
static_configs:
62+
- targets:
63+
- cadvisor:8080
64+
metric_relabel_configs:
65+
- source_labels: [ __name__ ]
66+
regex: '^(go_|cadvisor_version_info).+'
67+
action: drop
68+
- job_name: stacks
69+
scrape_interval: 5s
70+
static_configs:
71+
- targets:
72+
- stacks-miner-1:9153
73+
- stacks-miner-2:9153
74+
- stacks-miner-3:9153

0 commit comments

Comments
 (0)