services: prometheus: image: prom/prometheus:latest container_name: prometheus user: "1000:1000" command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=2h' - '--storage.tsdb.min-block-duration=2h' - '--storage.tsdb.max-block-duration=2h' - '--web.enable-lifecycle' volumes: - /docker/monitoring/prometheus/config:/etc/prometheus - /docker/monitoring/prometheus/data:/prometheus ports: - "9090:9090" thanos-sidecar: image: thanosio/thanos:v0.34.0 container_name: thanos-sidecar user: "1000:1000" environment: - OBJSTORE_CONFIG={"type":"S3","config":{"bucket":"prometheus","endpoint":"172.16.201.208:9000","access_key":"your_key","secret_key":"your_secret","insecure":true}} command: - 'sidecar' - '--tsdb.path=/prometheus' - '--prometheus.url=http://prometheus:9090' - '--objstore.config=$$(OBJSTORE_CONFIG)' volumes: - /docker/monitoring/prometheus/data:/prometheus ports: - "10901:10901"