Skip to content
Open
Changes from 1 commit
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
83 changes: 83 additions & 0 deletions docker/docker-compose.provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,79 @@ services:
internal:
ipv4_address: 172.18.0.8
ipv6_address: fd00:aaaa::8
redis-exporter:
# Exports redis-stack metrics in Prometheus format on :9121, scraped by
# vector (sources.redis_metrics -> http://redis-exporter:9121/metrics).
container_name: redis-exporter
profiles:
- production
- staging
image: oliver006/redis_exporter:${REDIS_EXPORTER_IMAGE:-v1.62.0}
labels:
- "vector.docker=true" # log docker events
environment:
# The exporter connects to redis over the internal network. Without an
# explicit REDIS_ADDR it defaults to its own localhost:6379 and scrapes
# nothing. REDIS_PASSWORD is filled from the deploy-exported provider env
# (same value as REDIS_CONNECTION_PASSWORD); empty means no-auth redis.
- REDIS_ADDR=redis://redis-stack:6379
- REDIS_PASSWORD=${REDIS_CONNECTION_PASSWORD:-}
env_file:
Comment on lines +180 to +187

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and this is a known constraint — `${REDIS_CONNECTION_PASSWORD:-}` resolves at compose-render time from the shell/top-level `.env`, not from `env_file`. It is called out explicitly in the PR description as a deploy note: the var must be exported into the deploy shell at `compose up` (the same way `HOST_IPV4` already is) for a password-protected Redis to authenticate. The deploy/ansible that renders and exports the provider env lives outside this repo, so the right fix is on that side rather than hardcoding here. Leaving the `:-` default so a no-auth Redis still works. @goastler to confirm the export against the deploy tooling.

- ../.env.1.${NODE_ENV}
depends_on:
redis-stack:
condition: service_started
Comment thread
Copilot marked this conversation as resolved.
Outdated
restart: unless-stopped # unless the container has been stopped, it will be restarted, even on reboot
expose:
- "9121"
networks:
internal:
ipv4_address: 172.18.0.11
ipv6_address: fd00:aaaa::b
logging:
driver: 'json-file'
options:
max-size: '100m'
max-file: '1'
cadvisor:
# Per-container resource metrics (cpu/memory/disk/network/...) in
# Prometheus format on :8080, scraped by vector
# (sources.cadvisor_metrics -> http://cadvisor:8080/metrics).
container_name: cadvisor
profiles:
- production
- staging
image: gcr.io/cadvisor/cadvisor:${CADVISOR_IMAGE:-v0.52.1}
labels:
- "vector.docker=true" # log docker events
# cadvisor needs broad host access to read cgroup/container stats.
privileged: true
devices:
- /dev/kmsg
command:
- '--enable_metrics=cpu,cpuLoad,memory,disk,diskIO,network,process,pressure,oom_event,percpu,app,tcp,udp'
- '--store_container_labels=false'
- '--whitelisted_container_labels=com.docker.compose.service,com.docker.compose.project'
- '--docker_only=true'
volumes:
- /:/rootfs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
restart: unless-stopped
expose:
- "8080"
networks:
internal:
ipv4_address: 172.18.0.12
ipv6_address: fd00:aaaa::c
logging:
driver: 'json-file'
options:
max-size: '100m'
max-file: '1'
vector:
container_name: vector
profiles:
Expand All @@ -178,8 +251,18 @@ services:
labels:
- "vector.docker=true" # log docker events
restart: unless-stopped # unless the container has been stopped, it will be restarted, even on reboot
# sources.host_metrics reads /proc and /sys. Inside a container these are
# the container's own namespaced views, so without these mounts the
# "host" metrics would actually describe the vector container. Mount the
# host's procfs/sysfs read-only and point vector at them via
# PROCFS_ROOT/SYSFS_ROOT so host_metrics reports true host CPU/mem/disk/net.
environment:
- PROCFS_ROOT=/host/proc
- SYSFS_ROOT=/host/sys
volumes:
- /var/run/docker.sock:/var/run/docker.sock # needed for monitoring docker container events, e.g. start/stop/etc
- /proc:/host/proc:ro
- /sys:/host/sys:ro
networks:
external:
internal:
Expand Down
Loading