diff --git a/.gitignore b/.gitignore index 37e138d..89b0156 100644 --- a/.gitignore +++ b/.gitignore @@ -398,4 +398,5 @@ FodyWeavers.xsd *.sln.iml tools/ -MaxPower/out/ \ No newline at end of file +MaxPower/out/ +usage-with-docker-compose/volumes/ \ No newline at end of file diff --git a/usage-with-docker-compose/docker-compose.yml b/usage-with-docker-compose/docker-compose.yml new file mode 100644 index 0000000..4cb7a50 --- /dev/null +++ b/usage-with-docker-compose/docker-compose.yml @@ -0,0 +1,38 @@ +services: + maxpower: + image: awaescher/maxpower:latest + container_name: maxpower + ports: + - "8080:8080" + env_file: + - maxpower.env + restart: always + + prometheus: + image: prom/prometheus:latest + container_name: prometheus + user: root + command: + - '--storage.tsdb.retention.time=30d' # keep data 30 days - all the values below are just defaults that need to be defined if commands are used + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/usr/share/prometheus/console_libraries' + - '--web.console.templates=/usr/share/prometheus/consoles' + ports: + - "9090:9090" + volumes: + - ./volumes/prometheus/data:/prometheus + - ./volumes/prometheus/etc:/etc + restart: always + + grafana: + image: grafana/grafana:latest + container_name: grafana + ports: + - "9091:3000" + user: "0" + links: + - prometheus + volumes: + - ./volumes/grafana:/var/lib/grafana + restart: always \ No newline at end of file diff --git a/usage-with-docker-compose/maxpower.env b/usage-with-docker-compose/maxpower.env new file mode 100644 index 0000000..c463563 --- /dev/null +++ b/usage-with-docker-compose/maxpower.env @@ -0,0 +1,10 @@ +MaxSettings__PollIntervalSeconds=60 +MaxSettings__UseMockData=true + +Inverters__0__Ip=192.168.178.241 +Inverters__0__Id=1 +Inverters__0__Port=12345 + +Inverters__1__Ip=192.168.178.242 +Inverters__1__Id=2 +Inverters__1__Port=12345 \ No newline at end of file diff --git a/usage-with-docker-compose/volumes/prometheus/etc/prometheus/prometheus.yml b/usage-with-docker-compose/volumes/prometheus/etc/prometheus/prometheus.yml new file mode 100644 index 0000000..9efa08b --- /dev/null +++ b/usage-with-docker-compose/volumes/prometheus/etc/prometheus/prometheus.yml @@ -0,0 +1,8 @@ +global: + scrape_interval: 300s + evaluation_interval: 300s + +scrape_configs: + - job_name: "maxpower metrics" + static_configs: + - targets: ["maxpower:8080"] \ No newline at end of file