86 lines
2.1 KiB
YAML
86 lines
2.1 KiB
YAML
name: farm-control
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: farm-postgres
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
- POSTGRES_DB=${POSTGRES_DB}
|
|
- TZ=${TZ}
|
|
volumes:
|
|
- ./data/postgres:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
mosquitto:
|
|
image: eclipse-mosquitto:2
|
|
container_name: farm-mqtt
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
|
|
- ./data/mosquitto:/mosquitto/data
|
|
- ./data/mosquitto-log:/mosquitto/log
|
|
ports:
|
|
- "1883:1883"
|
|
|
|
grafana:
|
|
image: grafana/grafana:11.6.0
|
|
container_name: farm-grafana
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
environment:
|
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
|
|
- TZ=${TZ}
|
|
volumes:
|
|
- ./data/grafana:/var/lib/grafana
|
|
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
|
- ./grafana/dashboards:/etc/grafana/dashboards:ro
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
- postgres
|
|
- prometheus
|
|
|
|
nodered:
|
|
image: nodered/node-red:4.0.9
|
|
container_name: farm-nodered
|
|
restart: unless-stopped
|
|
environment:
|
|
- TZ=${TZ}
|
|
volumes:
|
|
- ./data/nodered:/data
|
|
ports:
|
|
- "1880:1880"
|
|
depends_on:
|
|
- mosquitto
|
|
- postgres
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v3.2.1
|
|
container_name: farm-prometheus
|
|
restart: unless-stopped
|
|
command:
|
|
- --config.file=/etc/prometheus/prometheus.yml
|
|
- --storage.tsdb.path=/prometheus
|
|
- --storage.tsdb.retention.time=30d
|
|
- --storage.tsdb.retention.size=20GB
|
|
volumes:
|
|
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- ./data/prometheus:/prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
|
|
networks:
|
|
default:
|
|
name: farm-control-net
|