Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ x-backend: &backend
LENS_TELEMETRY: ${LENS_TELEMETRY:-}
LENS_TELEMETRY_ENDPOINT: ${LENS_TELEMETRY_ENDPOINT:-}
LENS_TELEMETRY_HEADERS: ${LENS_TELEMETRY_HEADERS:-}
# Prometheus (docs/prometheus.md): /metrics, off unless LENS_PROMETHEUS=on with a LENS_PROMETHEUS_TOKEN; the
# monitoring profile below scrapes it and charts it in Grafana at LENS_GRAFANA_URL
LENS_PROMETHEUS: ${LENS_PROMETHEUS:-}
LENS_PROMETHEUS_TOKEN: ${LENS_PROMETHEUS_TOKEN:-}
LENS_GRAFANA_URL: ${LENS_GRAFANA_URL:-}
# the volume shared with the matterbridge service (its config, written from Settings → Chat rooms)
LENS_MATTERBRIDGE_DIR: /matterbridge
# upgrading from the web app (docs/updates.md): the folder install.sh's upgrade agent watches, and the install folder
Expand Down Expand Up @@ -183,6 +188,63 @@ services:
- opensearch-data:/usr/share/opensearch/data
networks: [lens]

# Prometheus, node-exporter and Grafana (docs/prometheus.md): charts of Lens and this machine over time, ready made.
# Opt-in: in .env set COMPOSE_PROFILES=monitoring, LENS_PROMETHEUS=on, LENS_PROMETHEUS_TOKEN (openssl rand -hex 32)
# and LENS_GRAFANA_URL=http://localhost:3001, then `docker compose up -d`. Grafana listens where the web app does
# (LENS_BIND), on LENS_GRAFANA_PORT (3001); anyone who reaches it may view, and only the admin may change things.
prometheus:
image: prom/prometheus:${PROMETHEUS_VERSION:-v3.5.0}
profiles: [monitoring]
security_opt: ["no-new-privileges:true"]
entrypoint: ["/bin/sh", "-c"]
command:
- >-
printf %s "$$LENS_PROMETHEUS_TOKEN" > /prometheus/lens-token &&
exec /bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus
--storage.tsdb.retention.time=$${LENS_METRICS_DAYS:-30}d
environment:
LENS_PROMETHEUS_TOKEN: ${LENS_PROMETHEUS_TOKEN:-}
LENS_METRICS_DAYS: ${LENS_METRICS_DAYS:-30}
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
restart: unless-stopped
networks: [lens]

node-exporter:
image: prom/node-exporter:${NODE_EXPORTER_VERSION:-v1.9.1}
profiles: [monitoring]
security_opt: ["no-new-privileges:true"]
command: ["--path.rootfs=/host"]
pid: host
volumes:
- /:/host:ro,rslave
restart: unless-stopped
networks: [lens]

grafana:
image: grafana/grafana-oss:${GRAFANA_VERSION:-12.0.2}
profiles: [monitoring]
security_opt: ["no-new-privileges:true"]
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin} # Grafana asks to change admin on first sign-in
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/lens-dashboard.json
GF_ANALYTICS_REPORTING_ENABLED: "false"
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: "false"
GF_NEWS_NEWS_FEED_ENABLED: "false"
ports:
- "${LENS_BIND:-127.0.0.1}:${LENS_GRAFANA_PORT:-3001}:3000"
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./docs/grafana:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
depends_on: [prometheus]
restart: unless-stopped
networks: [lens]

volumes:
surreal-data:
matterbridge-data:
Expand All @@ -191,6 +253,8 @@ volumes:
archive-data:
fedora-data:
opensearch-data:
prometheus-data:
grafana-data:

networks:
lens:
Expand Down
Loading
Loading