Files
compose-anything/src/prometheus/docker-compose.yaml
Sun-ZhenXing c03771751c feat(opensandbox): add initial configuration files and documentation for OpenSandbox platform
feat(elasticsearch): upgrade Elasticsearch version to 9.3.0 in environment and docker-compose files

feat(gitlab): update GitLab version to 18.8.3-ce.0 in environment and docker-compose files

feat(grafana): bump Grafana version to 12.3.2 in environment and docker-compose files

feat(jenkins): upgrade Jenkins version to 2.541-lts-jdk17 in environment and docker-compose files

fix(minio): remove unnecessary newline in docker-compose file

feat(nginx): downgrade Nginx version to 1.28.2-alpine3.22 in environment and docker-compose files

feat(ollama): update Ollama version to 0.14.3 in environment and docker-compose files

feat(prometheus): upgrade Prometheus version to 3.5.1 in environment and docker-compose files

feat(rabbitmq): update RabbitMQ version to 4.2.3-management-alpine in environment and docker-compose files
2026-02-07 18:11:02 +08:00

61 lines
1.8 KiB
YAML

x-defaults: &defaults
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
services:
prometheus:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}prom/prometheus:${PROMETHEUS_VERSION:-v3.5.1}
ports:
- "${PROMETHEUS_PORT_OVERRIDE:-9090}:9090"
volumes:
- prometheus_data:/prometheus
# Optional: Mount custom configuration
# - ./prometheus.yml:/etc/prometheus/prometheus.yml
# - ./rules:/etc/prometheus/rules
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME:-15d}"
- "--storage.tsdb.retention.size=${PROMETHEUS_RETENTION_SIZE:-}"
- "--web.enable-lifecycle"
- "--web.enable-admin-api"
- "--web.external-url=${PROMETHEUS_EXTERNAL_URL:-http://localhost:9090}"
environment:
- TZ=${TZ:-UTC}
- PROMETHEUS_RETENTION_TIME=${PROMETHEUS_RETENTION_TIME:-15d}
- PROMETHEUS_RETENTION_SIZE=${PROMETHEUS_RETENTION_SIZE:-}
user: "65534:65534" # nobody user
deploy:
resources:
limits:
cpus: ${PROMETHEUS_CPU_LIMIT:-1.0}
memory: ${PROMETHEUS_MEMORY_LIMIT:-2G}
reservations:
cpus: ${PROMETHEUS_CPU_RESERVATION:-0.25}
memory: ${PROMETHEUS_MEMORY_RESERVATION:-512M}
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:9090/-/healthy",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
prometheus_data: